Closed YogliB closed 6 years ago
Probably related to / caused by this:
Should be fixed with vue-loader
15.2.3. Please let us know if the issue persists after updating vue-loader
via npm update --depth=9999 vue-loader
I was getting the same thing from a cloned repo (cloned from my main computer where I haven't had any issues).
Tried the above npm update --depth=9999 vue-loader
, but that didn't work. So, I referenced https://github.com/vuejs/vue-loader/commit/0fb51728ea265bc7239d05006cbfcfaca1197a2c and edited NS myself, and that seems to have done the trick.
λ yarn serve
yarn run v1.12.3
$ vue-cli-service serve
INFO Starting development server...
94% after seal
ERROR Failed to compile with 1 errors 15:02:54
error in ./src/main.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
ReferenceError: [BABEL] F:\qianduan_dir\00program\web-vue-cli3\todo-\src\main.js: Unknown option: .polyfills. Check out https://babeljs.io/docs/en/babel-core/#options f
or more information about options.
at throwUnknownError (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\validation\options.js:123:11)
at Object.keys.forEach.key (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\validation\options.js:107:5)
at Array.forEach (<anonymous>)
at validateNested (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\validation\options.js:83:21)
at validate (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\validation\options.js:74:10)
at instantiatePreset (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\full.js:244:36)
at cachedFunction (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\caching.js:33:19)
at loadPresetDescriptor (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\full.js:235:45)
at config.presets.reduce (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\full.js:77:21)
at Array.reduce (<anonymous>)
at recurseDescriptors (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\full.js:74:38)
at loadFullConfig (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\config\full.js:108:6)
at process.nextTick (F:\qianduan_dir\00program\web-vue-cli3\todo-\node_modules\@babel\core\lib\transform.js:28:33)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
@ multi (webpack)-dev-server/client?http://192.168.2.103:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
ERROR in ./resources/js/views/admin/main/index.vue?vue&type=template&id=fa8fd28a&scoped=true& (./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/admin/main/index.vue?vue&type=template&id=fa8fd28a&scoped=true&) Module Error (from ./node_modules/vue-loader/lib/loaders/templateLoader.js): (Emitted value instead of an instance of Error) Error compiling template:
sameish here: "export 'default' (imported as 'mod') was not found in '-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DashCard.vue?vue&type=script&lang=js&'
I am also having the same issue, but with a vue project on glitch.com using pnpm
ERROR Failed to compile with 1 errors3:57:00 AM
This dependency was not found:
* -!../../rbd/pnpm-volume/b2c7ff97-dc14-4295-b604-0cd2e497217b/node_modules/.registry.npmjs.org/cache-loader/1.2.5/webpack@4.28.4/node_modules/cache-loader/dist/cjs.js??ref--12-0!../../rbd/pnpm-volume/b2c7ff97-dc14-4295-b604-0cd2e497217b/node_modules/.registry.npmjs.org/babel-loader/8.0.5/@babel!core@7.2.2/node_modules/babel-loader/lib/index.js!../../rbd/pnpm-volume/b2c7ff97-dc14-4295-b604-0cd2e497217b/node_modules/.registry.npmjs.org/cache-loader/1.2.5/webpack@4.28.4/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../rbd/pnpm-volume/b2c7ff97-dc14-4295-b604-0cd2e497217b/node_modules/.registry.npmjs.org/vue-loader/15.5.1/css-loader@1.0.1+webpack@4.28.4/node_modules/vue-loader/lib/index.js??vue-loader-options!./app.vue?vue&type=script&lang=js& in ./src/app.vue?vue&type=script&lang=js&
To install it, you can run: npm install --save -!../../rbd/pnpm-volume/b2c7ff97-dc14-4295-b604-0cd2e497217b/node_modules/.registry.npmjs.org/cache-loader/1.2.5/webpack@4.28.4/node_modules/cache-loader/dist/cjs.js??ref--12-0!../../rbd/pnpm-volume/b2c7ff97-dc14-4295-b604-0cd2e497217b/node_modules/.registry.npmjs.org/babel-loader/8.0.5/@babel!core@7.2.2/node_modules/babel-loader/lib/index.js!../../rbd/pnpm-volume/b2c7ff97-dc14-4295-b604-0cd2e497217b/node_modules/.registry.npmjs.org/cache-loader/1.2.5/webpack@4.28.4/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../rbd/pnpm-volume/b2c7ff97-dc14-4295-b604-0cd2e497217b/node_modules/.registry.npmjs.org/vue-loader/15.5.1/css-loader@1.0.1+webpack@4.28.4/node_modules/vue-loader/lib/index.js??vue-loader-options!./app.vue?vue&type=script&lang=js&
Having the same problem, npm run serve
was working fine. Installed fontawesome-free now I am unable to start the server.
This dependency was not found:
- in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js&
EDIT: Inside my App.vue I had written import ""; this is what was causing my errors, removed the line and all is working again. Feel like this is a beginners mistake...
I have the same issue.
ERROR in ./node_modules/css-loader/dist/cjs.js??ref--4-2!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=style&index=0&lang=css&
Module build failed: CssSyntaxError: /.../vue-hackernews-2.0/src/App.vue:1:1: Unknown word
same here after deleting HelloWorld.vue
- ./components/HelloWorld.vue in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js&
any fix to this? Having the same issue
It clearly says
vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.
In my webpack.base.conf.js
I added the following lines:
'use strict'
...
const { VueLoaderPlugin } = require('vue-loader')
...
module.exports = {
context: ...,
entry: {
...
},
output: {
...
},
resolve: {
...
},
module: {
rules: [
...
]
},
node: {
...
},
plugins: [
...
new VueLoaderPlugin(),
...
]
}
(and of course, install it with npm install --save-dev vue-loader vue-template-compiler
, see here)
... which resolved the first issue for me, but now I got another error saying:
Failed to compile with 4 errors
These relative modules were not found:
* ./App.vue?vue&type=style&index=0&lang=css& in ./src/App.vue
* ./Hello.vue?vue&type=style&index=0&id=361a4bd2&scoped=true&lang=css& in ./src/components/Hello.vue
* ./assets/logo.png in ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=template&id=7ba5bd90&
* ./assets/dj.png in ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=template&id=7ba5bd90&
which seems to have to do with that VueLoaderPlugin, and with the VueTemplateCompiler if I got it right?
EDIT: Figured out that I missed to install some packages which where used by my webpack config.
Copied from another thread
Spent a whole day on this. In my case, my webpack config used postcss-loader
in the rules for css loading, but I did not install it via npm install --save-dev postcss-loader
.
The error message said nothing about "postcss-loader", the error was simply
* ./Hello.vue?vue&type=style&index=0&id=361a4bd2&scoped=true&lang=css& in ./src/components/Hello.vue
* ./App.vue?vue&type=style&index=0&lang=scss& in ./src/App.vue
Other two errors, namely
* ./assets/logo.png in ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=template&id=7ba5bd90&
* ./assets/dj.png in ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=template&id=7ba5bd90&
happened for the same general reason and mistake: I had declared (ok I did not but I copied a config which did) a module (and that's what was mentioned by the error, a module could not be found!), which I did not install, in this case: url-loader
installed it via npm install --save-dev url-loader
and the error went away.
Basically, you have to watch out that all modules which are used by your webpack config files are also installed in node_modules.
E.g. my webpack config which caused the above problems looked like this:
module: {
rules: [
...
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
see the url-loader for image files? (and of course postcss-loader for style files)
You can basically apply that rule for any module which is declared in the config but not appearing in package.json
. Install it, the error might go away.
This relative module was not found:
Can someone tell me the solution? complete newbie in vue.
This error also occurs if node-sass module is not found.
Here's the solution:
sudo npm install --save-dev --unsafe-perm node-sass
Enjoy!
Anyone willing to help. I tried creating my first Vue app and I got this error.
Failed to compile.
./src/App.vue?vue&type=script&lang=js& (./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js&)
Module not found: Error: Can't resolve './components/test' in 'C:\Users\Geeky\Desktop\project\real-world-vue\src'
I have the same error output as @Dalexz4 but this is occurring when I try to use a newly installed node package through yarn, built through webpack and running on a Docker container.
vue-loader
or cache-loader
are preventing the new package from being recognized. I also noticed that if I remove an already existing package, it still says I have it. Does anyone know how to resolve this cache/loader issue?
Update:
Found out the issue was related to the volumes section of my docker-compose.yml
file declaring the node_modules
directory as immutable data. Which was preventing the container from recognizing any new changes to packages outside of the ones it was initially built with.
@ ./node_modules/vue-style-loader??ref--9-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--9-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Home.vue?vue&type=style&index=0&id=8dc7cce2&scoped=true&lang=scss& 4:14-459 15:3-20:5 16:22-467 @ ./src/components/Home.vue?vue&type=style&index=0&id=8dc7cce2&scoped=true&lang=scss& @ ./src/components/Home.vue @ ./src/main.js @ multi (webpack)-dev-server/client?http://192.168.0.101:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
make sure you're not missing out your pacakge.lock.json
@ ./node_modules/vue-style-loader??ref--9-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--9-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Home.vue?vue&type=style&index=0&id=8dc7cce2&scoped=true&lang=scss& 4:14-459 15:3-20:5 16:22-467 @ ./src/components/Home.vue?vue&type=style&index=0&id=8dc7cce2&scoped=true&lang=scss& @ ./src/components/Home.vue @ ./src/main.js @ multi (webpack)-dev-server/client?http://192.168.0.101:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
I am getting same error. How to fix this error?
I get below error when I tab the npm run dev
, it seems the problem of vue-cli-plugin-version. Can someone solve this? thank you~
ERROR Failed to compile with 1 error 上午8:04:45
error in ./node_modules/vue-cli-plugin-vusion/scenes/doc/components/common/u-h2-tabs.vue/module.css?vue&type=style&index=0&module=true&lang=css&
Syntax Error: Error: Can't resolve 'i-material-design.vue/assets/filled/close.svg' in 'F:\PreWorkThings\lowCode\CodeWaveAssetCompetition2024\heatmap_mayuo\node_modules\vue-cli-plugin-vusion\scenes\doc\components\common\u-h2-tabs.vue'
@ ./node_modules/vue-style-loader??ref--7-oneOf-0-0!./node_modules/css-loader/dist/cjs.js??ref--7-oneOf-0-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/icon-font-loader!./node_modules/postcss-loader/src??ref--7-oneOf-0-3!./node_modules/vue-cli-plugin-vusion/webpack/loaders/module-class-priority-loader!./node_modules/ifdef-loader/ifdef-loader.js??ref--7-oneOf-0-5!./node_modules/vue-cli-plugin-vusion/scenes/doc/components/common/u-h2-tabs.vue/module.css?vue&type=style&index=0&module=true&lang=css& 4:14-445 15:3-20:5 16:22-453 @ ./node_modules/vue-cli-plugin-vusion/scenes/doc/components/common/u-h2-tabs.vue/module.css?vue&type=style&index=0&module=true&lang=css& @ ./node_modules/vue-cli-plugin-vusion/scenes/doc/components/common/u-h2-tabs.vue/index.js @ ./node_modules/vue-cli-plugin-vusion/scenes/doc/components sync .vue$ @ ./node_modules/vue-cli-plugin-vusion/scenes/doc/views/docEntry.js @ ./node_modules/vue-cli-plugin-vusion/scenes/doc/views/material.js @ multi ./node_modules/icon-font-loader/src/fontface.css (webpack)-dev-server/client?http://172.31.227.56:9091&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./node_modules/vue-cli-plugin-vusion/scenes/doc/views/material.js
Error from chokidar (F:): Error: EBUSY: resource busy or locked, lstat 'F:\DumpStack.log.tmp'
Compiled with problems: ERROR in ./src/Views/Programmations/EditProgrammations.vue?vue&type=script&lang=js (./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/Views/Programmations/EditProgrammations.vue?vue&type=script&lang=js) 10:0-45 Module not found: Error: Can't resolve 'html-to-image' in 'C:\Users\PC-GTECH-002\Documents\GitHub\com.supervizr\front-vuejs\src\Views\Programmations' ERROR in ./src/components/PrintBadge.vue?vue&type=script&lang=js (./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/PrintBadge.vue?vue&type=script&lang=js) 1:0-45 Module not found: Error: Can't resolve 'html-to-image' in 'C:\Users\PC-GTECH-002\Documents\GitHub\com.supervizr\front-vuejs\src\components' ERROR in ./src/components/PrintBadge.vue?vue&type=script&lang=js (./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/PrintBadge.vue?vue&type=script&lang=js) 2:0-34 Module not found: Error: Can't resolve 'downloadjs' in 'C:\Users\PC-GTECH-002\Documents\GitHub\com.supervizr\front-vuejs\src\components'
Good morning I get the same error. How to correct this error?
Version
3.0.0-beta.15
Reproduction link
https://github.com/YogliB/vue-cli_test
Steps to reproduce
What is expected?
The app will be compiled/transpiled and served.
What is actually happening?