Meir
Meir

Reputation: 594

Next unknown build errors

When I build locally on my PC, I have no problems. When I build on heroku or on vercel, I get the errors below saying "cant resolve module xxxxxx". I was able to build in the past with vercel. I do not no what I did wrong since my last commit that is causing those errors. I am currently running next version 9.5.1, but I also had errors when I downgraded to version 9.3.3

Here are the remote logs from heroku:

Failed to compile.

remote: ./components/layout/landing/HomePageTabs.js

remote: Module not found: Can't resolve '../../products/productDetails/ProductAccessories' in '/tmp/build_4be1adef/components/layout/landing'

remote: > Build error occurred

remote: Error: > Build failed because of webpack errors

remote: at build (/tmp/build_4be1adef/node_modules/next/dist/build/index.js:13:900)

remote: npm ERR! code ELIFECYCLE

remote: npm ERR! errno 1

remote: npm ERR! [email protected] build: next build

remote: npm ERR! Exit status 1

remote: npm ERR!

remote: npm ERR! Failed at the [email protected] build script.

remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

remote: npm ERR! A complete log of this run can be found in:

remote: npm ERR! /tmp/npmcache.osZbj/_logs/2020-08-14T15_00_22_594Z-debug.log

remote: -----> Build failed

Upvotes: 0

Views: 1574

Answers (1)

Meir
Meir

Reputation: 594

The problem was I imported files without being sensitive to their casing so a file with name api.js I mistakenly imorted as Api.js. On windows, this is not a problem, but on linux machines, this can cause issues. I added a bable plugin that disallows you to import case from insensitive paths.

Upvotes: 1

Related Questions