Closed dmitry-sidorov closed 2 years ago
Can you post the full log with the debug
flag enabled? :)
I have same issue. The following is the log with the Debug flag enabled.
% yarn workspace @web/site start
yarn workspace v1.22.19
yarn run v1.22.19
$ next dev --port 3100
ready - started server on 0.0.0.0:3100, url: http://localhost:3100
next-transpile-modules - trying to resolve the following modules:
- @mish/error-codes
next-transpile-modules - the following paths will get transpiled:
- /Users/malt03/Documents/service/mish/mish-app/packages/error-codes
info - automatically enabled Fast Refresh for 1 custom loader
error - ../../../node_modules/escalade/sync/index.js:2:32
Module not found: Can't resolve 'fs'
Import trace for requested module:
../../../node_modules/next-transpile-modules/src/next-transpile-modules.js
../../../node_modules/@web/next-config/lib/cjs/next-config.js
../../../node_modules/@web/next-config/lib/cjs/index.js
./src/pages/_app.page.tsx
https://nextjs.org/docs/messages/module-not-found
info - automatically enabled Fast Refresh for 1 custom loader
wait - compiling /_error (client and server)...
error - ../../../node_modules/escalade/sync/index.js:2:32
Module not found: Can't resolve 'fs'
Import trace for requested module:
../../../node_modules/next-transpile-modules/src/next-transpile-modules.js
../../../node_modules/@web/next-config/lib/cjs/next-config.js
../../../node_modules/@web/next-config/lib/cjs/index.js
./src/pages/_app.page.tsx
https://nextjs.org/docs/messages/module-not-found
Are you running your apps in a specific JS runtime environment? Like Bun or Vercel Edge?
I fixed this issue for me.. randomly))
I have helpers.ts file in src directory. There is an import in this file:
import { basePath } from '../next.config';
So, I have silent typescript error:
Module '"../next.config"' has no exported member 'basePath'.ts
There is no error in node console, eslint tells everything is fine. But when I fixed it, 'fs' error goes away and everything works.
@malt03 Check typescript errors with IDE in your project, I guess. No idea why my ts error was silent.
After trying a number of things, it appears that the problem is specific to my project. My problem has not been resolved, but you can close this Issue.
Thanks!
Are you trying to transpile a local package or an npm package? @alfalab/core-components
Describe the bug Hello! I'm trying to transpile package @alfalab/core-components and got this:
Expected behavior build succeeded.
Setup
next-transpile-modules
version: 9.0.0yarn
version: 1.22.19I use next config from issue https://github.com/core-ds/core-components/issues/22, but still not working.
My next.config.js looks like:
This error is caused by escalade package, which is in dependencies for next-transpile-modules