-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Error: Cannot find module './syntax-css-in-js' [v0.87.2] #237
Comments
Thanks for the bug report! I haven't been able to reproduce this bug, at least the way that I'm trying to. Could you provide some more details about your stylelint configuration and perhaps a code sample? |
I think this is probably because the bundle tool can't handle I think it might work fine if you use your local stylelint instead of the built-in stylelint. |
@adalinesimonian |
@adalinesimonian https://github.com/stylelint/stylelint/blob/13.13.1/lib/formatters/index.js I think it would work if the js file referenced by |
Had no idea this resolution was taking place, thanks for the pointer. Syntaxes are removed in 14 so this wouldn't be an issue for 1.x?
When I was testing, it was still in a subdirectory of vscode-stylelint so it looks like stylelint got picked up from node_modules, which is why I wasn't able to reproduce the bug. I created a workspace outside of the extension's directory and this bug immediately came up.
My guess is that lib/syntaxes/index.js is not working because If the individual files are set up as their own entry points, then so long as there is not a similar pattern of |
I think it's removed in the v14 branch, so I don't think it's an issue in stylelint v14 and this extension v1.x. |
@ota-meshi I just tested setting up each syntax-*.js file as its own entry point and it looks like that fixes this bug. I'm going to push up a fix PR momentarily. |
Fixes #237 The bundler cannot recognize the requires in the stylelint library for syntaxes, due to the lazy loads in the form `importLazy('package')` obscuring the require that is taking place. This patch adds each syntax as its own entry point to bypass this limitation. It will no longer be necessary when targeting stylelint 14. see: https://github.com/stylelint/stylelint/blob/13.13.1/lib/syntaxes/index.js
Fixes #237 The bundler cannot recognize the requires in the stylelint library for syntaxes, due to the lazy loads in the form `importLazy('package')` obscuring the require that is taking place. This patch adds each syntax as its own entry point to bypass this limitation. It will no longer be necessary when targeting stylelint 14. see: https://github.com/stylelint/stylelint/blob/13.13.1/lib/syntaxes/index.js
v0.87.3 has a fix for this bug and should be available shortly. |
Thanks everyone ❤️ Can confirm it's fixed now 😄 |
Fixes #239 postcss-syntax uses require statements without string literals, so the bundler is unable to recognize the dependencies at bundle time. This fork uses static requires for packages used in vscode-stylelint to allow the proper resolution of packages. This fix, along with the fix for #237, will no longer be required for 1.x of this package, which will be tracking stylelint 14. see adalinesimonian/postcss-syntax@ba1d4a6
* fix: use postcss-syntax fork until 1.x Fixes #239 postcss-syntax uses require statements without string literals, so the bundler is unable to recognize the dependencies at bundle time. This fork uses static requires for packages used in vscode-stylelint to allow the proper resolution of packages. This fix, along with the fix for #237, will no longer be required for 1.x of this package, which will be tracking stylelint 14. see adalinesimonian/postcss-syntax@ba1d4a6
Stylelint no longer works and throws an error on every keystroke
None, editing an average JS file
None, editing an average JS file
Probably not, error throws without needing to save
Not sure?
No
stylelint to work and not throw an error
Error: Cannot find module './syntax-css-in-js'
Error: Cannot find module './syntax-css-in-js' Require stack: - /Users/jwm/.vscode/extensions/stylelint.vscode-stylelint-0.87.2/dist/server.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:934:15) at Module._load (internal/modules/cjs/loader.js:779:27) at Function.f._load (electron/js2c/asar_bundle.js:5:12913) at Module.require (internal/modules/cjs/loader.js:1006:19) at require (internal/modules/cjs/helpers.js:88:18) at dD (/Users/jwm/.vscode/extensions/stylelint.vscode-stylelint-0.87.2/dist/server.js:57:49885) at Object.get (/Users/jwm/.vscode/extensions/stylelint.vscode-stylelint-0.87.2/dist/server.js:57:49933) at BNt (/Users/jwm/.vscode/extensions/stylelint.vscode-stylelint-0.87.2/dist/server.js:232:17424) at Object.pNt (/Users/jwm/.vscode/extensions/stylelint.vscode-stylelint-0.87.2/dist/server.js:232:19679) at new e (/Users/jwm/.vscode/extensions/stylelint.vscode-stylelint-0.87.2/dist/server.js:99:1222)
The text was updated successfully, but these errors were encountered: