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

Error with nodejs example #168

Closed
ellis2323 opened this issue Feb 20, 2022 · 3 comments · Fixed by #169
Closed

Error with nodejs example #168

ellis2323 opened this issue Feb 20, 2022 · 3 comments · Fixed by #169
Labels
bug Something isn't working released

Comments

@ellis2323
Copy link

I have this error with node 14.5 version:


file:///C:/Users/laure/Documents/Perso/Sources/live/node_modules/mdb-reader/lib/codec-handler/handlers/office/agile/EncryptionDescriptor.js:1
import { XMLParser } from "fast-xml-parser";
         ^^^^^^^^^
SyntaxError: The requested module 'fast-xml-parser' is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export.
For example:
import pkg from 'fast-xml-parser';
const { XMLParser } = pkg;
    at ModuleJob._instantiate (internal/modules/esm/module_job.js:98:21)
    at async ModuleJob.run (internal/modules/esm/module_job.js:137:5)
    at async Loader.import (internal/modules/esm/loader.js:162:24)
    at async formattedImport (C:\Users\laure\Documents\Perso\Sources\live\node_modules\mocha\lib\esm-utils.js:7:14)
    at async Object.exports.loadFilesAsync (C:\Users\laure\Documents\Perso\Sources\live\node_modules\mocha\lib\esm-utils.js:55:20)
    at async singleRun (C:\Users\laure\Documents\Perso\Sources\live\node_modules\mocha\lib\cli\run-helpers.js:125:3)
    at async Object.exports.handler (C:\Users\laure\Documents\Perso\Sources\live\node_modules\mocha\lib\cli\run.js:362:5)

It seems the problem comes with 'src/codec-handler/handlers/office/agile/EncryptionDescriptor.js' file.

Best regards,

@andipaetzold
Copy link
Owner

Hey 👋

I was able to reproduce your error. It looks like this import only works from node 14.13 and breaks with earlier versions.

I'll work on an update to make it work for earlier node versions as well.

@github-actions
Copy link

🎉 This issue has been resolved in version 2.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@andipaetzold
Copy link
Owner

Version 2.1.1 should fix your issue. Feel free to reopen the issue if you still run into problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants