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.

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.js

    import { 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)
  • 😯 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-sfc does NOT solve it either

… 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:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mischniccommented, Dec 30, 2020

Take a look at your lockfile:

So this is more of an inconsistency caused by Yarn 🤷

1reaction
mischniccommented, Jan 1, 2021

Is the behavior of the nightly version (hard dependency on @parcel/transformer-vue) intended to stay?

From the config to the transformer? Yes.

efficient to include all transformer dependencies by default

The transformers themselves are always installed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vue.js - Simple reactivity experiment in Svelte fails in ...
I've found a few ways to fix that issue and get the Svelte component to work as intended. But, I'm curious about why...
Read more >
Installation - Vue.js
Vue does not support IE8 and below, because it uses ECMAScript 5 features that are un-shimmable in IE8. However it supports all ECMAScript...
Read more >
Using Vue 3's Router in Practice - Daily.dev
So let's look at how we can install Vue Router to our Vue 3 project. Installing Vue Router for Vue 3. Like many...
Read more >
Frequently asked questions — Vuetify
My application is not working. I'm seeing $attrs is readonly and/or $listeners is readonly in the console. I'm seeing Error Module parse “failed”....
Read more >
Troubleshooting Omnibus GitLab installation issues
You can fix this by running sudo gitlab-ctl reconfigure , which sets the gitlab_shell_t security context on /var/opt/gitlab/.ssh . In GitLab 10.0 this...
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