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

[BUG] - Version 3.1.4 can't be consumed from Common JS #468

Closed
johnsoukka opened this issue Jan 19, 2023 · 2 comments
Closed

[BUG] - Version 3.1.4 can't be consumed from Common JS #468

johnsoukka opened this issue Jan 19, 2023 · 2 comments
Labels

Comments

@johnsoukka
Copy link

Context

What version of the module does this affect?
3.1.4

Expected outcome

I expect the code to run without issues.

Actual outcome

I get a type error: TypeError: P.parse is not a function

Description

It seems that from version 3.1.4 it is not possible to consume the lib from Common JS code with require.

Not entirely sure if it is a bug or me missing something else. I can see that in version 3.1.4 esbuild was introduced as the bundler instead of using rollup.

Minimal reproducible test case

In a terminal (npm and node are required) run these commands in order:

mkdir test
cd test
npm init -y
npm i -E personnummer@3.1.3
echo "const P = require('personnummer');console.log(P.parse('2012121212'));" > index.js
node index

That works fine. Now:

npm i -E personnummer@3.1.4
node index

It crashes on TypeError: P.parse is not a function

@johnsoukka johnsoukka added the bug label Jan 19, 2023
@frozzare
Copy link
Member

Thanks for the bug report, i'll look into it.

This was referenced Jan 19, 2023
@frozzare
Copy link
Member

Fixed in 3.1.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants