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

Module not found: Error: Default condition should be last one #2

Closed
Vuizur opened this issue Dec 13, 2022 · 5 comments
Closed

Module not found: Error: Default condition should be last one #2

Vuizur opened this issue Dec 13, 2022 · 5 comments

Comments

@Vuizur
Copy link

Vuizur commented Dec 13, 2022

Hello,

thanks for creating this project!

With the standard install, I encountered this error, but managed to resolve it like described in this comment: mpociot/chatgpt-vscode#1 (comment)

(I don't know how the affected file is created though)

@wan2land
Copy link
Member

Did you import and use it as follows?

import superserial from 'superserial'

This package does not provide default exports. You must explicitly use the class you want to use.

import { Serializer } from 'superserial'

You can use an autocomplete class or type like this:

If this doesn't work, please tell me in detail about the version of yarn or npm and how you reproduced it. thank you 😄

@Vuizur
Copy link
Author

Vuizur commented Dec 25, 2022

Thank you very much for the reply. 😀

I used it like this:

import { Serializer } from 'superserial'

My data: Windows, npm 9.2.0

At first I assumed it could be fixed by doing the same thing as done here: transitive-bullshit/agentic@343157c

But then I couldn't find a package.json in your repo, so now I have no idea.

@wan2land
Copy link
Member

I finally found it. 😄 It was a problem that only happened in the webpack environment.

https://github.com/webpack/enhanced-resolve/blob/main/lib/util/entrypoints.js#L455

Referring to the package.json document, it is recommended to use the default item last.

https://nodejs.org/api/packages.html

I am using a package.json file created through a library called dnt. Fortunately, the related bug was fixed a week ago.

https://github.com/denoland/dnt/releases/tag/0.32.1

It will be redeployed after rebuilding.

@wan2land
Copy link
Member

try v0.3.3 😄

wan2land added a commit to denostack/reformdata that referenced this issue Dec 26, 2022
wan2land added a commit to denostack/inthash that referenced this issue Dec 26, 2022
@Vuizur
Copy link
Author

Vuizur commented Dec 26, 2022 via email

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

2 participants