Fix Vue Support (unpredictable installation behavior)
See original GitHub issue🐛 bug report
Build fails with Error: No transformers found for "/home/pitizzzle/parcel-vue-test/src/App.vue".
But ONLY when dependencies have been installed manually via yarn add, and NOT when they have been installed from package.json via yarn 😅 (hence “unpredictable installation behavior”).
🎛💻 Minimal Working Example
-
package.json{ "scripts": { "setup": "yarn add --dev parcel@next vue@next", "build": "parcel build src/index.html" } } -
src/index.html<!DOCTYPE html> <html> <head></head> <body> <div id="app"></div> <script src="main.js"></script> </body> </html> -
src/main.jsimport { createApp } from 'vue'; import App from './App.vue'; createApp(App).mount('#app'); -
src/App.vue<template> <h1>{{ "Hello World" }}</h1> </template> <script> export default {}; </script>
yarn setup
yarn build
-
🤔 Expected Behavior:
- error
@parcel/transformer-vue: Cannot find module '@vue/compiler-sfc'(expected case below in more detail)
- error
-
😯 Current Behavior:
$ parcel build src/index.html 🚨 Build failed. Error: No transformers found for "/home/pitizzzle/parcel-vue-test/src/App.vue". Error: No transformers found for "/home/pitizzzle/parcel-vue-test/src/App.vue". at ParcelConfig._getTransformerNodes (/home/pitizzzle/parcel-vue-test/node_modules/@parcel/core/lib/ParcelConfig.js:157:13) at ParcelConfig.getTransformerNames (/home/pitizzzle/parcel-vue-test/node_modules/@parcel/core/lib/ParcelConfig.js:164:29) at ConfigLoader.loadParcelConfig (/home/pitizzzle/parcel-vue-test/node_modules/@parcel/core/lib/ConfigLoader.js:82:37) at /home/pitizzzle/parcel-vue-test/node_modules/@parcel/core/lib/ConfigLoader.js:54:48 at processTicksAndRejections (internal/process/task_queues.js:93:5) at async PromiseQueue._runFn (/home/pitizzzle/parcel-vue-test/node_modules/@parcel/utils/lib/PromiseQueue.js:98:7) at async PromiseQueue._next (/home/pitizzzle/parcel-vue-test/node_modules/@parcel/utils/lib/PromiseQueue.js:85:5) error Command failed with exit code 1.- note:
yarn add --dev @parcel/transformer-vue @vue/compiler-sfcdoes NOT solve it either
- note:
… and now with installation from package.json …
# cleanup
rm -rf node_modules/ yarn.lock .parcel-cache/
# install from package.json
yarn
yarn build
- console output:
$ parcel build src/index.html 🚨 Build failed. @parcel/transformer-vue: Cannot find module '@vue/compiler-sfc' from '/home/pitizzzle/parcel-vue-test/src' Error: Cannot find module '@vue/compiler-sfc' from '/home/pitizzzle/parcel-vue-test/src' at /home/pitizzzle/parcel-vue-test/node_modules/resolve/lib/async.js:116:35 at processDirs (/home/pitizzzle/parcel-vue-test/node_modules/resolve/lib/async.js:269:39) at isdir (/home/pitizzzle/parcel-vue-test/node_modules/resolve/lib/async.js:276:32) at isDirectory (/home/pitizzzle/parcel-vue-test/node_modules/@parcel/utils/lib/resolve.js:92:9) error Command failed with exit code 1.- (this is the expected error for my code example)
🌍 Environment
| Software | Version(s) |
|---|---|
| Node | v14.15.1 |
| Yarn | 1.22.5 |
| Operating System | Ubuntu 20.04.1 LTS (WSL under Windows 10) |
💁 Possible Solution
If this bug can not easily be solved, please at least improve the error message, because currently, the user is not presented any solution for the occuring error. You could add something like Error: No transformers found for "/home/pitizzzle/parcel-vue-test/src/App.vue". This might be related to your installation method. Try to uninstall all dependencie and then reinstall them from "package.json"..
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)

Top Related StackOverflow Question
Take a look at your lockfile:
"parcel": "^2.0.0-beta.1"installs nightly versions of everything (because of semver 😬 https://jubianchi.github.io/semver-check/#/^2.0.0-beta.1/2.0.0-nightly.500)yarn add parcel@nextactually installs2.0.0-beta.1.So this is more of an inconsistency caused by Yarn 🤷
From the config to the transformer? Yes.
The transformers themselves are always installed.