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

Cannot find module 'postcss-html/extract' Require ... #239

Closed
faisalrehmanlums opened this issue Sep 29, 2021 · 7 comments · Fixed by #240
Closed

Cannot find module 'postcss-html/extract' Require ... #239

faisalrehmanlums opened this issue Sep 29, 2021 · 7 comments · Fixed by #240
Assignees
Labels
type: bug a problem with a feature or rule

Comments

@faisalrehmanlums
Copy link

Error on new version Cannot find module 'postcss-html/extract' Require ...

Details:

Error: Cannot find module 'postcss-html/extract' Require stack: - /root/.vscode-server/extensions/stylelint.vscode-stylelint-0.87.3/dist/server.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15) at Function.Module._load (internal/modules/cjs/loader.js:725:27) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at MEe (/root/.vscode-server/extensions/stylelint.vscode-stylelint-0.87.3/dist/server.js:232:17287) at BNt (/root/.vscode-server/extensions/stylelint.vscode-stylelint-0.87.3/dist/server.js:232:17396) at Object.pNt (/root/.vscode-server/extensions/stylelint.vscode-stylelint-0.87.3/dist/server.js:232:19679) at new e (/root/.vscode-server/extensions/stylelint.vscode-stylelint-0.87.3/dist/server.js:99:1222) at /root/.vscode-server/extensions/stylelint.vscode-stylelint-0.87.3/dist/server.js:232:22867

@samik3k
Copy link

samik3k commented Sep 29, 2021

Same error here

1 similar comment
@woooha
Copy link

woooha commented Sep 29, 2021

Same error here

@adamdotjs
Copy link

Happening here too, seems to be because of the update yesterday.

@clintecker
Copy link

Also getting this beginning yesterday

@adalinesimonian adalinesimonian self-assigned this Sep 29, 2021
@adalinesimonian adalinesimonian added priority: high type: bug a problem with a feature or rule labels Sep 29, 2021
@adalinesimonian
Copy link
Member

adalinesimonian commented Sep 29, 2021

Initial investigation: potentially related to #237 and #76. Problem line is from postcss-syntax:

syntaxConfig = {
	extract: require(syntax.toLowerCase().replace(/^(postcss-)?/i, "postcss-") + "/extract"), // error happens here
};

Probably caused due to esbuild being unable to determine package names at bundle time.

adalinesimonian added a commit that referenced this issue Sep 29, 2021
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
adalinesimonian added a commit that referenced this issue Sep 29, 2021
* 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
@adalinesimonian
Copy link
Member

v0.87.4 contains a fix for this bug and should be available shortly.

@clintecker
Copy link

Thank you @adalinesimonian !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug a problem with a feature or rule
Development

Successfully merging a pull request may close this issue.

6 participants