Hi,
I try to use Parcel Bundler for Plugin generation first time and I get the error
No entries found.
at Bundler.bundle (…lib/node_modules/parcel-bundler/src/Bundler.js:275:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! threeviewer@ dev: `parcel watch src/index.js --no-source-maps -d ./`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the threeviewer@ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! …/.npm/_logs/2021-07-17T00_18_33_551Z-debug.log
I thought that Parcel should generate this index.js and index.css if I run npm run dev the first time.
This is my package.json:
{
"name": "threeviewer",
"scripts": {
"dev": "parcel watch src/index.js --no-source-maps -d ./",
"build": "parcel build src/index.js --no-source-maps --experimental-scope-hoisting -d ./"
},
"devDependencies": {
"@vue/component-compiler-utils": "^3.2.0",
"cssnano": "^4.1.11",
"scss": "^1.35.2",
"vue-template-compiler": "^2.6.14"
},
"dependencies": {
"vue": "^2.6.14",
"vue-hot-reload-api": "^2.3.4"
}
}
```
If i run `npm install` it tries to search for the threeview plugin, which I will create actually.
So what have I missunderstood or do I wrong?
Cheers
Hello Sonja,
I tried Parcel next but there I hat also some problems and I see that it is actually in beta so I switched back.
Parcel: 1.12.5
Node: 12.22.1
npm: 6.14.8
I recently was frustrated enough by parcel, its eternal beta and “experimental scope hoisting”, its continuous problems with vue, that I switched to rollup. Works great atm, it’s more complicated, but at least I have stuff under control.
I know this isn’t really an answer, but just know that you aren’t the only one having random problems with Parcel.
Anyway, no entries found normally means that the indicated source file does not exist.
Are you sure the path “src/index.js” is exact? Could you screenshot the folder structure?
It’s more complicated cause it’s more than a command line (at least how I’m currently using it - I like the “code over config” approach).
Here’s a snippets from a build script for a plugin:
Only thing is to be careful when choosing the rollup-plugin-vue package version, as the newest version (v6) builds for Vue 3. These are my devDependencies:
plugin-commonjs and plugin-node-resolve are used because I import some stuff from node_modules and those use the “node style” require() imports.
If you’re only doing ES6 imports and don’t require stuff from node_modules, you don’t need those.
This script also does not transcode your javascript with babel since the Kirby panel requirements are anyway rather modern.
Anyway, no entries found normally means that the indicated source file does not exist.
Are you sure the path “src/index.js” is exact? Could you screenshot the folder structure?
Yes, but I thought that parcel will generate them. Or I have misunderstood what @bastianallgeier did in his Youtube Video.
At the first start here parcel copies also a lot of modules and do other stuff. At me I couldn’t see anything of that in my terminal.
So I created the index.js by hand. The error I mentioned is gone.
Now I have problem with my Websocket connection. It looks that something from parce_bundler is missing.
I think there is something wrong with the installation or I don’t know.
But it doesn’t looks to me that parcel is not a timesaver more the opposite.
Parcel should generate the main index.js file in the plugin root (/site/plugins/your-plugin-name/index.js) from /site/plugins/your-plugin-name/src/index.js
No, it shouldn’t. The first argument after watch/build is the input file, which is always src/index.js, the output path is given as last argument, i.e. ./.