question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

🐛 BUG: Snowpack doesn't work with Yarn berry: skypack tried to access tar

See original GitHub issue

Quick checklist

  • I am using the latest version of Snowpack and all plugins.

What package manager are you using?

yarn

What operating system are you using?

macOS Big Sur

Describe the bug

I am not sure what is making side-effect but every time I create a new project and switch to Yarn berry via the command yarn set version berry, Snowpack won’t start the development server. Also, the build command doesn’t work.

/Users/username/seia/repositories/portfolio/.pnp.js:11954
    throw firstError;
    ^

Error: skypack tried to access tar, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: tar (via "tar")
Required by: skypack@npm:0.3.2 (via /Users/username/seia/repositories/portfolio/.yarn/cache/skypack-npm-0.3.2-7801704069-9e3dbb10a4.zip/node_modules/skypack/lib/)

Require stack:
- /Users/username/seia/repositories/portfolio/.yarn/cache/skypack-npm-0.3.2-7801704069-9e3dbb10a4.zip/node_modules/skypack/lib/index.js
- /Users/username/seia/repositories/portfolio/.yarn/cache/snowpack-npm-3.8.2-d207dff0f8-eeea1eeca8.zip/node_modules/snowpack/lib/cjs/util.js
- /Users/username/seia/repositories/portfolio/.yarn/cache/snowpack-npm-3.8.2-d207dff0f8-eeea1eeca8.zip/node_modules/snowpack/lib/cjs/commands/add-rm.js
- /Users/username/seia/repositories/portfolio/.yarn/cache/snowpack-npm-3.8.2-d207dff0f8-eeea1eeca8.zip/node_modules/snowpack/lib/cjs/index.js
- /Users/username/seia/repositories/portfolio/.yarn/cache/snowpack-npm-3.8.2-d207dff0f8-eeea1eeca8.zip/node_modules/snowpack/index.bin.js
    at internalTools_makeError (/Users/username/seia/repositories/portfolio/.pnp.js:11698:34)
    at resolveToUnqualified (/Users/username/seia/repositories/portfolio/.pnp.js:12663:23)
    at resolveRequest (/Users/username/seia/repositories/portfolio/.pnp.js:12755:29)
    at Object.resolveRequest (/Users/username/seia/repositories/portfolio/.pnp.js:12833:26)
    at Function.external_module_.Module._resolveFilename (/Users/username/seia/repositories/portfolio/.pnp.js:11931:34)
    at Function.external_module_.Module._load (/Users/username/seia/repositories/portfolio/.pnp.js:11796:48)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Object.<anonymous> (/Users/username/seia/repositories/portfolio/.yarn/cache/skypack-npm-0.3.2-7801704069-9e3dbb10a4.zip/node_modules/skypack/lib/index.js:10:31)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)

Steps to reproduce

  1. mkdir tmp
  2. cd tmp
  3. yarn create snowpack-app . --force --use-yarn --template @snowpack/app-template-react
  4. yarn set version berry
  5. yarn
  6. yarn start

Link to minimal reproducible example (optional)

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
PindaPixelcommented, Aug 6, 2021

When can we expect this in release?

0reactions
seia-sotocommented, Aug 21, 2021

Nice implementation. I hope this issue resolves as fast as possible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Bug] Your application tried to access @snowpack/plugin ...
Describe the bug. The Snowpack build tool doesn't work with Yarn v2, or rather, when PNP is enabled. We list both Snowpack and...
Read more >
Troubleshooting | Yarn
This error simply means that the specified package is requiring something without explicitly declaring it in its dependencies. Since this behavior is unsafe...
Read more >
Making a dependency's dependencies available with Yarn 2
Error : Your application tried to access @snowpack/plugin-dotenv, but it isn't declared in your dependencies; this makes the require call ...
Read more >
Getting started with Yarn 2 and TypeScript | by xsmith - Medium
One of the best things about Yarn 2 is that it started using available resources instead of forcing you to adapt to new...
Read more >
Building a Monorepo with Yarn 2 - Heroku Blog
Yarn 2 is officially supported by Heroku. Here's a popular use case for Yarn enhanced by Yarn 2: using workspaces to manage dependencies...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found