Error when trying to use postcss-comment with Vite/PostCSS 8
Opened this issue · 0 comments
AndrewBogdanovTSS commented
Pcakages:
"vite": "^2.3.7"
"postcss": "8.2.6"
"postcss-nested": "^5.0.5"
"postcss-comment": "^2.0.0"
postcss.config.js
module.exports = {
parser: require('postcss-comment'),
plugins: {
'postcss-nested': {}
}
}
index.pcss
// Test
@import "layout.pcss";
Error:
[vite] Internal server error: Class constructor Parser cannot be invoked without 'new'
at new InlineParser (C:\Projects\Study\vue
\vue3-vite2\node_modules\postcss-comment\lib\par
ser.js:10:10)
at parse (C:\Projects\Study\vue\vue3-vite2
\node_modules\postcss-comment\lib\parse.js:13:18
)
at compileCSS (C:\Projects\Study\vue\vue3-vite2\node_modules\vite\dist\node\chunks\dep-bc228bbb.js:23457:10)
.
js:23076:50)
at async Object.transform (C:\Projects\Study\vue\vue3-vite2\node_modules\vite\dist\node\chunks\dep-bc228bbb.js:44765:3
0)
at async transformRequest (C:\Projects\Study\vue\vue3-vite2\node_modules\vite\dist\node\chunks\dep-bc228bbb.js:59029:2
9)
at async viteTransformMiddleware (C:\Projects\Study\vue\vue3-vite2\node_modules\vite\dist\node\chunks\dep-bc228bbb.js:
59167:32) (x2)