-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
NodeJS is resolving this package as CommonJS because a package.json file with "type": "module" is missing from the esm output.
Here is the error I am getting:
SyntaxError: Named export 'LabelFilter' not found. The requested module '@azure/app-configuration-provider' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from '@azure/app-configuration-provider';
const { LabelFilter, load } = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:220:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:321:5)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)
Node.js v22.17.1
If I add a package.json to the dist/esm folder with the contents below, then the error is fixed:
{
"type": "module"
}I copied this from the @azure/app-configuration package's esm folder.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels