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 resolution failing due to missing name field in package.json #1071

Closed
1 of 2 tasks
alecmarcus opened this issue Jan 30, 2024 · 1 comment
Closed
1 of 2 tasks
Labels
bug Something isn't working triage New issues that needs consideration

Comments

@alecmarcus
Copy link

alecmarcus commented Jan 30, 2024

Bug report

Packages affected

  • sandpack-client
  • sandpack-react

Description of the problem

When adding the @vanilla-extract/vite-plugin to the vite-react-ts config, the internal module resolution fails, complaining that the package from nodebox's node_modules have a name field.

error when starting dev server:
Error: Couldn't find parent package.json with a name field from '/nodebox'
    at Object.getPackageInfo (nodebox:///nodebox/node_modules/.store/@vanilla-extract/integration@6.4.0/node_modules/@vanilla-extract/integration/dist/vanilla-extract-integration.cjs.dev.js:338:11)
    at configResolved (nodebox:///nodebox/node_modules/.store/@vanilla-extract/vite-plugin@3.9.5/node_modules/@vanilla-extract/vite-plugin/dist/vanilla-extract-vite-plugin.cjs.dev.js:85:33)
    at eval (nodebox:///nodebox/node_modules/.store/vite@4.1.4/node_modules/vite/dist/node/chunks/dep-ca21228b.js:62127:28)
    at Array.map (<anonymous>)
    at resolveConfig (nodebox:///nodebox/node_modules/.store/vite@4.1.4/node_modules/vite/dist/node/chunks/dep-ca21228b.js:62127:14)
    at async createServer (nodebox:///nodebox/node_modules/.store/vite@4.1.4/node_modules/vite/dist/node/chunks/dep-ca21228b.js:61191:20)
    at async CAC.eval (nodebox:///nodebox/node_modules/.store/vite@4.1.4/node_modules/vite/dist/node/cli.js:741:24)

The package referenced in the error does have one. It does not have a "parent package" (ie, @vanilla-extract) however.
https://github.com/vanilla-extract-css/vanilla-extract/blob/fa7105066a5fbb70822af89939abcc48731aeb2e/packages/integration/package.json#L2
https://github.com/vanilla-extract-css/vanilla-extract/blob/951131127feee1e1a0a13b0b4e11e9ae2ba26536/packages/vite-plugin/package.json#L2

What were you doing when the problem occurred?

  1. Set up a basic sandpack instance following the tutorial (I'm doing mine inside Astro)
  2. Set the template to vite-react-ts
  3. Set up vanilla extract inside the sandpack instance
  4. Server error shows the above

Link to sandbox: link

Your Environment

Software Name/Version
Sandpack-react version 2.11.3
Browser Arc, Chrome
Operating System macOS M2
@alecmarcus
Copy link
Author

Looks specific to vanilla extract: vanilla-extract-css/vanilla-extract#413 (comment)

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

No branches or pull requests

1 participant