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

Please verify that the package.json has a valid "main" entry #1546

Closed
matiosfree opened this issue Apr 5, 2021 · 2 comments
Closed

Please verify that the package.json has a valid "main" entry #1546

matiosfree opened this issue Apr 5, 2021 · 2 comments
Labels

Comments

@matiosfree
Copy link

Describe the bug
When I'm trying to use it on some project React+Webpack+TypeScript, I'm getting an error:

Error: Cannot find module 'node_modules\@swc\core\index.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (internal/modules/cjs/loader.js:303:19)
    at Function.Module._findPath (internal/modules/cjs/loader.js:516:18)

Input code

webpack config:

{
        test:/\.(js|jsx|ts|tsx)$/,
        loader: 'swc-loader',
        exclude: /node_modules/
},

Config

{
  "jsc": {
    "parser": {
      "syntax": "typescript",
      "tsx": true,
      "decorators": true
    }
  }
}

Expected behavior
no error happens

Version
The version of @swc/core: v1.2.52 (master branch)

@matiosfree
Copy link
Author

matiosfree commented Apr 5, 2021

ah, sorry for that. seems I installed sources from master but not the builded package, because in the 1.2.51 I'm getting #1477

@swc-bot
Copy link
Collaborator

swc-bot commented Oct 25, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants