Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package.json's exports field causes issues #147

Closed
martpie opened this issue Dec 10, 2020 · 28 comments
Closed

Package.json's exports field causes issues #147

martpie opened this issue Dec 10, 2020 · 28 comments
Labels
6.x bug Something isn't working

Comments

@martpie
Copy link
Owner

martpie commented Dec 10, 2020

Is there something wrong with enhanced-resolve and it cannot detect ESM via exports?

@martpie martpie added 6.x bug Something isn't working labels Dec 10, 2020
@simlrh
Copy link

simlrh commented Jan 19, 2021

Same issue with dequal package - I'm working around it by adding exportsFields: [] to the enhanced-resolve config.

@martpie
Copy link
Owner Author

martpie commented Jan 19, 2021

Well that's interesting, but kinda defeat the purpose of exports fields 🤔

@martpie
Copy link
Owner Author

martpie commented Jan 28, 2021

I just tried with nanoid, everything seems to be working fine 🤔 exports field is well respected

@martpie martpie closed this as completed Jan 28, 2021
@Algram
Copy link

Algram commented Feb 4, 2021

@martpie it does not seem fixed on our end. The two packages we have problems with are dequal and nanoid.
With next-transpile-modules:6.2.0 and next:10.0.6 we get the following error when transpiling:

image

Is there a quick workaround for this issue specifically?

Thanks for your time!

@andrekorolev
Copy link

I have the same problem with the same packages and versions.

nanoid:3.1.20 package.json:
"exports": { ".": { "browser": { "development": "./index.dev.js", "production": "./index.prod.js" }, "require": "./index.cjs", "import": "./index.js", "types": "./index.d.ts" }, "./package.json": "./package.json", "./async/package.json": "./async/package.json", "./async": { "browser": "./async/index.browser.js", "require": "./async/index.cjs", "import": "./async/index.js" }, "./non-secure/package.json": "./non-secure/package.json", "./non-secure": { "require": "./non-secure/index.cjs", "import": "./non-secure/index.js" }, "./url-alphabet/package.json": "./url-alphabet/package.json", "./url-alphabet": { "require": "./url-alphabet/index.cjs", "import": "./url-alphabet/index.js" }, "./index.d.ts": "./index.d.ts" }

@martpie with what versions did you have it work?

@martpie
Copy link
Owner Author

martpie commented Feb 8, 2021

I used (at the time) the latest next + ntm, and I could use nanoid with withTM with any error.

Do you have a reproduction for me?

@andrekorolev
Copy link

nothing special
I added nanoid in my next.config.js:
const withTM = require('next-transpile-modules')(['nanoid']);
and when I run build I see:
Error: next-transpile-modules - an unexpected error happened when trying to resolve "nanoid" Error: Package path . is not exported from package /Users/z/a/b/c/node_modules/nanoid (see exports field in /Users/z/a/b/c/node_modules/nanoid/package.json) at getPackageRootDirectory (/Users/z/a/b/c/node_modules/next-transpile-modules/src/next-transpile-modules.js:83:11)

Next - 10.0.6
NTM - 6.2.0
nanoid - 3.1.20
yarn - 1.22.10
node - 14.15.4

@martpie martpie reopened this Feb 8, 2021
@martpie
Copy link
Owner Author

martpie commented Feb 8, 2021

The problem seems to be coming from upstream and enhanced-resolve

@Algram
Copy link

Algram commented Feb 8, 2021

@martpie Thanks a lot for investigating! In the meantime, is there any short term fix my team can apply? Otherwise we would have to wait for the maintainers of dequal and nanoid.

@daphnesmit
Copy link

This probably has to do with NPM 7?

@martpie
Copy link
Owner Author

martpie commented Feb 8, 2021

no, nothing to do with npm. I have a fix on master (that I don't understand, but it works). I would like to finish a couple of other things and then I will trigger a release.

@martpie
Copy link
Owner Author

martpie commented Feb 8, 2021

Can anyone confirm me it's fixed in 6.3.0?

@andrekorolev
Copy link

it works now, no error during compilation in console.
Although app is not opened in IE =D but it seems to be a local problem
@martpie thanks for quick fix

@Algram
Copy link

Algram commented Feb 8, 2021

@martpie @andrekorolev it does unfortunately not fix the underlying problem: nanoid and dequal still do not get transpiled. The difference now is that the build succeeds though. Once you open the app in IE11, javascript breaks the page since IE can not parse arrow functions and const statements that are now in the bundle (from nanoid and dequal).

EDIT:
Here you can see that untranspiled statement:
image

@martpie
Copy link
Owner Author

martpie commented Feb 8, 2021

Can you output here the debug log? (see README)

@Algram
Copy link

Algram commented Feb 8, 2021

@martpie sure, here you go:

This is the config:
image

This is the output:

next-transpile-modules - WARNING experimental Webpack 5 support enabled
next-transpile-modules - the following paths will get transpiled:
  - /home/username/dev/shop/node_modules/clean-stack
  - /home/username/dev/shop/node_modules/crypto-hash
  - /home/username/dev/shop/node_modules/dequal
  - /home/username/dev/shop/node_modules/escape-string-regexp
  - /home/username/dev/shop/node_modules/is-plain-obj
  - /home/username/dev/shop/node_modules/nanoid
  - /home/username/dev/shop/node_modules/query-string
  - /home/username/dev/shop/node_modules/recoil
  - /home/username/dev/shop/node_modules/split-on-first
  - /home/username/dev/shop/node_modules/strict-uri-encode
  - /home/username/dev/shop/node_modules/yn
info  - Using external babel configuration from /home/username/dev/shop/babel.config.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/cjs/recoil.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/es/recoil.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/strict-uri-encode/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/split-on-first/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/yn/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/nanoid/index.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/cjs/recoil.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/yn/lenient.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/es/recoil.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/crypto-hash/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/nanoid/url-alphabet/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/crypto-hash/browser.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/cjs/recoil.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/nanoid/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/yn/index.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/cjs/recoil.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/yn/index.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/cjs/recoil.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/yn/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/yn/lenient.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/es/recoil.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/es/recoil.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/yn/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/cjs/recoil.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/cjs/
recoil.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/cjs/recoil.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/es/recoil.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/es/recoil.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/cjs/recoil.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/cjs/recoil.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/yn/index.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/es/recoil.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/yn/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/cjs/recoil.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/yn/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/es/recoil.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/dequal/dist/index.mjs
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/nanoid/index.browser.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/es/recoil.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/nanoid/index.browser.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/nanoid/url-alphabet/index.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/es/recoil.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/recoil/es/recoil.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/strict-uri-encode/index.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/split-on-first/index.js
next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/is-plain-obj/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/dev/shop/node_modules/query-string/index.js
(node:17755) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.
BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
	Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
	Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.
(Use `node --trace-deprecation ...` to show where the warning was created)
info  - Creating an optimized production build  
warn  - Compiled with warnings

@martpie
Copy link
Owner Author

martpie commented Feb 8, 2021

Well, when I do a yarn create next-app, the default app does not even run on IE11, so I assume this is a problem on Next.js side. The nanoid files are getting transpiled it appears

@martpie
Copy link
Owner Author

martpie commented Feb 8, 2021

Still testing a few things on my side.

@martpie
Copy link
Owner Author

martpie commented Feb 8, 2021

Working fine on my side, check your next config or your nanoid implementation. This might be due to another module that needs to be transpiled.

Screenshot 2021-02-08 173313

@martpie martpie closed this as completed Feb 8, 2021
@Algram
Copy link

Algram commented Feb 11, 2021

@martpie I am sorry to bother you again, but your example will work of course, since the page you show in the screenshot is rendered on the server. Have you actually checked if the client side hydration works in your example?

Basically what happens if you call nanoid() on the client and what does the browser console look like then?

@martpie
Copy link
Owner Author

martpie commented Feb 11, 2021

The page is re-hydrated on the browser (which causes a mismatch because nanoid will generate another string).

So yeah, nanoid is called on the browser as well.

@Algram
Copy link

Algram commented Feb 22, 2021

Hi @martpie,

after some more digging and debugging, we have found the offending package. It is clean-stack. This is not getting transpiled by next-transpile-modules now, but was before.

Could you maybe take the time and verify that?

Thanks so much!

@martpie
Copy link
Owner Author

martpie commented Feb 22, 2021

This is not next-transpile-modules's job to transpile the dependencies of the dependencies you try to transpile. If you use:

 const withTM = require('next-transpile-modules')(['nanoid']);

only nanoid will be transpiled. Not the dependencies of nanoid.

So you'd need to manually add clean-stack to the list (or open an issue on its repo).

@Algram
Copy link

Algram commented Feb 22, 2021

@martpie Sorry, forgot to mention, that I DO have clean-stack in the config:
image

Still it does not get transpiled.

EDIT: This is the debug log for this time. clean-stack does not seem to get transpiled:

next-transpile-modules - WARNING experimental Webpack 5 support enabled
next-transpile-modules - the following paths will get transpiled:
  - /home/username/project/node_modules/clean-stack
  - /home/username/project/node_modules/crypto-hash
  - /home/username/project/node_modules/dequal
  - /home/username/project/node_modules/escape-string-regexp
  - /home/username/project/node_modules/is-plain-obj
  - /home/username/project/node_modules/nanoid
  - /home/username/project/node_modules/query-string
  - /home/username/project/node_modules/recoil
  - /home/username/project/node_modules/split-on-first
  - /home/username/project/node_modules/strict-uri-encode
  - /home/username/project/node_modules/yn
  - /home/username/project/node_modules/aggregate-error
info  - Using external babel configuration from /home/username/project/babel.config.js
next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/es/recoil.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/cjs/recoil.js
next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/cjs/recoil.js
next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/cjs/recoil.js
next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/cjs/recoil.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/es/recoil.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/cjs/recoil.js
next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/es/recoil.js
next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/es/recoil.js
next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/es/recoil.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/cjs/recoil.js
next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/project/node_modules/yn/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/yn/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/yn/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/yn/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/yn/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/es/recoil.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/project/node_modules/yn/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/cjs/recoil.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/yn/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/split-on-first/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/cjs/recoil.js
next-transpile-modules - transpiled: /home/username/project/node_modules/strict-uri-encode/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/project/node_modules/strict-uri-encode/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/split-on-first/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/project/node_modules/nanoid/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/project/node_modules/yn/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/es/recoil.js
next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/es/recoil.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/yn/lenient.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/project/node_modules/nanoid/index.browser.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/project/node_modules/nanoid/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/project/node_modules/yn/lenient.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/cjs/recoil.js
next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/cjs/recoil.js
next-transpile-modules - transpiled: /home/username/project/node_modules/nanoid/index.browser.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/project/node_modules/crypto-hash/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/project/node_modules/crypto-hash/browser.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
[BABEL] Note: The code generator has deoptimised the styling of /home/username/project/src/generated/schemaTypesContentful.ts as it exceeds the max of 500KB.
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/project/node_modules/nanoid/url-alphabet/index.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/es/recoil.js
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/es/recoil.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/project/node_modules/nanoid/url-alphabet/index.js
[BABEL] Note: The code generator has deoptimised the styling of /home/username/project/src/generated/schemaTypesContentful.ts as it exceeds the max of 500KB.
info  - Creating an optimized production build .next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/project/node_modules/dequal/dist/index.mjs
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/cjs/recoil.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
next-transpile-modules - transpiled: /home/username/project/node_modules/is-plain-obj/index.js
info  - Creating an optimized production build ..next-transpile-modules - transpiled: /home/username/project/node_modules/query-string/index.js
info  - Creating an optimized production build ...next-transpile-modules - transpiled: /home/username/project/node_modules/recoil/es/recoil.js

@martpie
Copy link
Owner Author

martpie commented Feb 22, 2021

Can you paste here the content of clean-stack's package.json, and a screenshot of the package file structure in node_module?

@Algram
Copy link

Algram commented Feb 22, 2021

@martpie Sure, here you go:
image

image

@martpie
Copy link
Owner Author

martpie commented Feb 22, 2021

thanks, so I believe next-transpile-modules modules resolver may not be looking for index.js as a default file for modules. I'll have a look at it when I can. no, something else

@martpie
Copy link
Owner Author

martpie commented Feb 22, 2021

@Algram can you open a separate issue with a reproduction/piece of code that should be working but is not, etc?

So we avoid polluting this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.x bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants