https://github.com/vonBrax/nuxt-esm-bug
OS: MS Windows 10 Pro 10.0.17763 64-bits
From the provided repo:
git clone https://github.com/vonBrax/nuxt-esm-bugcd nuxt-esm-bugnpm installnpm run devFrom scratch:
npx create-nuxt-app nuxt-esm-bug (just default options)cd nuxt-esm-bugnpm i stylelint stylelint-webpack-pluginconst StyleLintPlugin = require('stylelint-webpack-plugin') - not even necessary to push it to config.pluginsnpm run devnormally compile the application and start dev server
Process exit with error 3221225725 (stack overflow):
npm ERR! code ELIFECYCLE
npm ERR! errno 3221225725
npm ERR! [email protected] dev: nuxt
npm ERR! Exit status 3221225725
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Tracking down the bug locally in the built package inside node_modules the offending line seems to be this one:
options = (nuxtConfigFile.endsWith('.ts') ? require(nuxtConfigFile) : esm(module, esmOptions)(nuxtConfigFile)) || {};And mapping it to the source code it seems to be here: https://github.com/nuxt/nuxt.js/blob/dev/packages/cli/src/utils/config.js#L28
Apparently this is a known issue from the esm package (< v3.20.1) when used in conjuction with some other packages like stylelint or node-sass running on windows machines. The issue is described here: https://github.com/standard-things/esm/issues/745
As stated in https://github.com/standard-things/esm/issues/745#issuecomment-477851101, upgrading esm to 3.20.1 seems to fix the issue.
I tested upgrading the package locally in my machine and indeed the issue is gone.
we cant update esm to anything higher than 3.20 because of https://github.com/standard-things/esm/issues/773
So when a new version of esm will be released then we update
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as pending will not be automatically marked as stale.
Looks like the update is coming soon ( https://github.com/standard-things/esm/commit/9432fad0d712cdcb434e655258f76bcbcc149747 )
Can this be closed @manniL ?
I would say so :relaxed:
Most helpful comment
we cant update esm to anything higher than 3.20 because of https://github.com/standard-things/esm/issues/773
So when a new version of esm will be released then we update