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

[Bug] Error with vue3 + vue-cli-plugin-mocha + Yarn Berry (V3) + PNP #129

Open
tragid opened this issue Apr 6, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@tragid
Copy link

tragid commented Apr 6, 2022

Reproduction link

github.com

Environment info

  System:
    OS: macOS 12.3.1
    CPU: (8) x64 Intel(R) Core(TM) i7-8557U CPU @ 1.70GHz
  Binaries:
    Node: 12.22.5 - ~/.nvm/versions/node/v12.22.5/bin/node
    Yarn: 3.2.0 - ~/.nvm/versions/node/v12.22.5/bin/yarn
    npm: 6.14.14 - ~/.nvm/versions/node/v12.22.5/bin/npm
  Browsers:
    Chrome: 100.0.4896.75
    Edge: Not Found
    Firefox: 98.0.2
    Safari: 15.4
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

  1. Clone project with vue3 and yarn berry. Example https://github.com/tragid/yarn-vue-mocha-bug
  2. run yarn install
  3. run yarn test:unit

What is expected?

Tests executed successfully.

What is actually happening?

Unit tests fail with errors:

RUNTIME EXCEPTION  Exception occurred while loading your tests

Error: Qualified path resolution failed: we looked for the following paths, but none could be accessed.

Source path: {PATH_TO_PROJECT}/yarn-vue-mocha-bug/dist/js/main.js
Not found: {PATH_TO_PROJECT}/yarn-vue-mocha-bug/dist/js/main.js
Not found: {PATH_TO_PROJECT}/yarn-vue-mocha-bug/dist/js/main.js.js
Not found: {PATH_TO_PROJECT}/yarn-vue-mocha-bug/dist/js/main.js.json
Not found: {PATH_TO_PROJECT}/yarn-vue-mocha-bug/dist/js/main.js.node

Require stack:
- {PATH_TO_PROJECT}/yarn-vue-mocha-bug/.yarn/cache/mocha-npm-8.4.0-a999d05791-4bcf006705.zip/node_modules/mocha/lib/mocha.js
- {PATH_TO_PROJECT}/yarn-vue-mocha-bug/.yarn/cache/mocha-npm-8.4.0-a999d05791-4bcf006705.zip/node_modules/mocha/index.js
- {PATH_TO_PROJECT}/yarn-vue-mocha-bug/.yarn/__virtual__/mochapack-virtual-ca470f35e0/0/cache/mochapack-npm-2.1.4-3d5d55697e-ede95202be.zip/node_modules/mochapack/lib/cli/argsParser/parseArgv/mocha/parseMochaArgs.js
- {PATH_TO_PROJECT}/yarn-vue-mocha-bug/.yarn/__virtual__/mochapack-virtual-ca470f35e0/0/cache/mochapack-npm-2.1.4-3d5d55697e-ede95202be.zip/node_modules/mochapack/lib/cli/argsParser/parseArgv/index.js
- {PATH_TO_PROJECT}/yarn-vue-mocha-bug/.yarn/__virtual__/mochapack-virtual-ca470f35e0/0/cache/mochapack-npm-2.1.4-3d5d55697e-ede95202be.zip/node_modules/mochapack/lib/cli/index.js
- {PATH_TO_PROJECT}/yarn-vue-mocha-bug/.yarn/__virtual__/mochapack-virtual-ca470f35e0/0/cache/mochapack-npm-2.1.4-3d5d55697e-ede95202be.zip/node_modules/mochapack/bin/mochapack
   at Function.require$$0.Module._resolveFilename ({PATH_TO_PROJECT}/yarn-vue-mocha-bug/.pnp.cjs:22225:13)
   at Function._resolveFilename ({PATH_TO_PROJECT}/yarn-vue-mocha-bug/.yarn/__virtual__/mochapack-virtual-ca470f35e0/0/cache/mochapack-npm-2.1.4-3d5d55697e-ede95202be.zip/node_modules/mochapack/src/util/registerRequireHook.ts:21:34)
   at Function.require$$0.Module._load ({PATH_TO_PROJECT}/yarn-vue-mocha-bug/.pnp.cjs:22079:42)
   at Module.require (internal/modules/cjs/loader.js:887:19)
   at require (internal/modules/cjs/helpers.js:74:18)
   at {PATH_TO_PROJECT}/yarn-vue-mocha-bug/.yarn/cache/mocha-npm-8.4.0-a999d05791-4bcf006705.zip/node_modules/mocha/lib/mocha.js:436:36
   at Array.forEach (<anonymous>)
   at Mocha.loadFiles ({PATH_TO_PROJECT}/yarn-vue-mocha-bug/.yarn/cache/mocha-npm-8.4.0-a999d05791-4bcf006705.zip/node_modules/mocha/lib/mocha.js:433:14)
   at Mocha.run ({PATH_TO_PROJECT}/yarn-vue-mocha-bug/.yarn/cache/mocha-npm-8.4.0-a999d05791-4bcf006705.zip/node_modules/mocha/lib/mocha.js:1012:10)
   at {PATH_TO_PROJECT}/yarn-vue-mocha-bug/.yarn/__virtual__/mochapack-virtual-ca470f35e0/0/cache/mochapack-npm-2.1.4-3d5d55697e-ede95202be.zip/node_modules/mochapack/src/runner/TestRunner.ts:128:23

 [=========================] 100% (completed)

ERROR  Error: mochapack exited with code 1.
Error: mochapack exited with code 1.
   at ChildProcess.<anonymous> ({PATH_TO_PROJECT}/yarn-vue-mocha-bug/.yarn/__virtual__/@vue-cli-plugin-unit-mocha-virtual-deed287469/0/cache/@vue-cli-plugin-unit-mocha-npm-5.0.1-3d48668535-768aa72c2e.zip/node_modules/@vue/cli-plugin-unit-mocha/index.js:86:18)
   at ChildProcess.emit (events.js:326:22)
   at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
@tragid tragid added the bug Something isn't working label Apr 6, 2022
@tragid tragid changed the title [Bug] Error with vue3 + vue-cli-plugin-mocha + Yarn Berry (V3) [Bug] Error with vue3 + vue-cli-plugin-mocha + Yarn Berry (V3) + PNP Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant