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

Cannot use in NodeJS without overwriting package.json entries #2

Open
tpo-celum opened this issue Oct 22, 2024 · 5 comments
Open

Cannot use in NodeJS without overwriting package.json entries #2

tpo-celum opened this issue Oct 22, 2024 · 5 comments
Assignees

Comments

@tpo-celum
Copy link

I'd like to use the psd-importer in a Node environment, which according to the readme is possible.

Looking at node_modules folder after installing the importer in my project I can see the following structure: a browser.js file and a node.js file.

image

Currently, in order to use the node.js file I have to make the following patches to the package.json of the psd-importer:

  • change the module, types and exports section to refer to the node files instead of the browser ones
  • change the type field value from "module" to "commonjs", because the node.js file is written as a commonjs module

In addition, in light of the above the NodeJS Quick-Start is quite confusing with the // We currently only support ES Modules in NodeJS comment.

image

@mirko314
Copy link
Collaborator

Thanks for reporting this issue @tpo-celum. We are looking into this and let you know once we finished our investigation.

@mirko314 mirko314 self-assigned this Oct 23, 2024
@bene-starzengruber
Copy link

hey @mirko314 - is there already an update on this issue?

@mirko314
Copy link
Collaborator

Hey @bene-starzengruber ,
due to current sickness season we were only just able to push out an release candidate for you to test.
Would you mind trying out if the new version 0.0.4-rc.0 works for you?
In this version, we would just release the same package for node/web with a ESModules version and a CommonJS version.

@tpo-celum
Copy link
Author

Hi @mirko314,
Thank you for the rc version, the package.json looks good, we tested it out and it works well!

@mirko314
Copy link
Collaborator

Happy to hear that!
We just published the official version 0.0.4 now that includes the fix!

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

No branches or pull requests

3 participants