-
Notifications
You must be signed in to change notification settings - Fork 369
Closed
Labels
JavaScriptIssues particular to the Node.js distributionIssues particular to the Node.js distributionbug
Description
Currently, it appears that an entryPoint is only found if argv
has exactly 2 arguments.
I'm observing this in a Vite project, with the css
key in vite.config.ts
setting up the package importer using the legacy API-
css: {
preprocessorOptions: {
scss: {
includePaths: [path.resolve('./src/sass/')],
pkgImporter: new NodePackageImporter(),
},
},
},
Running yarn vite
works, but yarn vite dev
fails with the The Node package importer cannot determine an entry point because
require.main.filename is not defined.
error. Stepping through sass.dart.js
in the debugger, I can see that the value of process.argv
contains 3 values, and so if (process.argv case [_, String path])
does not match.
We have worked around this issue by providing "."
as an entry point to the NodePackageImporter.
jgerigmeyer
Metadata
Metadata
Assignees
Labels
JavaScriptIssues particular to the Node.js distributionIssues particular to the Node.js distributionbug