This plugin tries to resolve the package.json files of processed modules:
|
const resolved = tryResolve( |
|
`${name}/package.json`, |
|
path.dirname(importer) |
|
); |
This breaks with npm modules that make use of the new exports field but do not specify a subpath export for the package.json file.
This issue surfaced in uuidjs/uuid#444
IMO this plugin can no longer expect that every npm module exports the package.json file and the resolver logic has to be adjusted accordingly.
Maybe in
|
function tryResolve(pkg, importer) { |
|
try { |
|
return relative.resolve(pkg, importer); |
|
} catch (err) { |
|
if (err.code === 'MODULE_NOT_FOUND') return null; |
|
throw err; |
|
} |
|
} |
we could add ERR_PACKAGE_PATH_NOT_EXPORTED as an "acceptable" error as well?
This plugin tries to resolve the
package.jsonfiles of processed modules:rollup-plugin-svelte/index.js
Lines 177 to 180 in 85d25fb
This breaks with npm modules that make use of the new
exportsfield but do not specify a subpath export for thepackage.jsonfile.This issue surfaced in uuidjs/uuid#444
IMO this plugin can no longer expect that every npm module exports the
package.jsonfile and the resolver logic has to be adjusted accordingly.Maybe in
rollup-plugin-svelte/index.js
Lines 48 to 55 in 85d25fb
we could add
ERR_PACKAGE_PATH_NOT_EXPORTEDas an "acceptable" error as well?