I got a new laptop where I wanted to run my librabry GitHub - Myrmod/svelte-babylon on it. For some reason though babylonjs-loaders is not being applied on it. The exact same code on my other devices works without a problem.
So my question is, what can I do to prevent this error:
BJS - [10:08:25]: Unable to find a plugin to load .glb files. Trying to use .babylon default plugin. To load from a specific filetype (eg. gltf) see: https://doc.babylonjs.com/how_to/load_from_any_file_type
Can I make a change to the package to make it better installable? I use vitejs as bundler/devtool and added this to its config:
It’s obviously a bug in vitebooks cache handling, but it might be something that library authors can catch.
I personally would like to have the possibility to import a loader plugin kinda like with the PhysicsEngine:
import * as cannon from 'cannon'
export let physicsPlugin: BABYLON.AmmoJSPlugin | BABYLON.CannonJSPlugin | BABYLON.OimoJSPlugin = new BABYLON.CannonJSPlugin(true, 10, cannon)
I will look into that! as I am slightly changing the way we build our packages. it seems like you are loading the actual .js file and not the package’s main file, but I wonder why this happens.
I am assigning myself and will load the repository to understand why this happens. I hope it is a simple change to our package.json file.
Finally got a chance to open the project, but I get the following errors when running it:
PS C:\Users\raweber\Documents\GitHub\svelte-babylon> npm run dev -- --open
> svelte-babylon@0.11.0 dev
> svelte-kit dev "--open"
> ENOENT: no such file or directory, scandir 'C:\Users\raweber\Documents\GitHub\svelte-babylon\src\routes'
Error: ENOENT: no such file or directory, scandir 'C:\Users\raweber\Documents\GitHub\svelte-babylon\src\routes'
at Object.readdirSync (node:fs:1392:3)
at walk (file:///C:/Users/raweber/Documents/GitHub/svelte-babylon/node_modules/@sveltejs/kit/dist/chunks/index2.js:448:15)
at create_manifest_data (file:///C:/Users/raweber/Documents/GitHub/svelte-babylon/node_modules/@sveltejs/kit/dist/chunks/index2.js:635:2)
at update_manifest (file:///C:/Users/raweber/Documents/GitHub/svelte-babylon/node_modules/@sveltejs/kit/dist/chunks/index.js:4221:27)
at Object.configureServer (file:///C:/Users/raweber/Documents/GitHub/svelte-babylon/node_modules/@sveltejs/kit/dist/chunks/index.js:4305:4)
at Object.createServer (C:\Users\raweber\Documents\GitHub\svelte-babylon\node_modules\vite\dist\node\chunks\dep-76613303.js:60468:41)
at async dev (file:///C:/Users/raweber/Documents/GitHub/svelte-babylon/node_modules/@sveltejs/kit/dist/chunks/index.js:4634:17)
at async file:///C:/Users/raweber/Documents/GitHub/svelte-babylon/node_modules/@sveltejs/kit/dist/cli.js:908:44
PS C:\Users\raweber\Documents\GitHub\svelte-babylon> npm run vitebook:dev
> svelte-babylon@0.11.0 vitebook:dev
> vitebook dev
> error: The entry point "C:/Users/raweber/Documents/GitHub/svelte-babylon/.vitebook/config.js" cannot be marked as external
Error: Build failed with 1 error:
error: The entry point "C:/Users/raweber/Documents/GitHub/svelte-babylon/.vitebook/config.js" cannot be marked as external
at failureErrorWithLog (C:\Users\raweber\Documents\GitHub\svelte-babylon\node_modules\@vitebook\core\node_modules\esbuild\lib\main.js:1475:15)
at C:\Users\raweber\Documents\GitHub\svelte-babylon\node_modules\@vitebook\core\node_modules\esbuild\lib\main.js:1133:28
at runOnEndCallbacks (C:\Users\raweber\Documents\GitHub\svelte-babylon\node_modules\@vitebook\core\node_modules\esbuild\lib\main.js:923:63)
at buildResponseToResult (C:\Users\raweber\Documents\GitHub\svelte-babylon\node_modules\@vitebook\core\node_modules\esbuild\lib\main.js:1131:7)
at C:\Users\raweber\Documents\GitHub\svelte-babylon\node_modules\@vitebook\core\node_modules\esbuild\lib\main.js:1240:14
at C:\Users\raweber\Documents\GitHub\svelte-babylon\node_modules\@vitebook\core\node_modules\esbuild\lib\main.js:611:9
at handleIncomingPacket (C:\Users\raweber\Documents\GitHub\svelte-babylon\node_modules\@vitebook\core\node_modules\esbuild\lib\main.js:708:9)
at Socket.readFromStdout (C:\Users\raweber\Documents\GitHub\svelte-babylon\node_modules\@vitebook\core\node_modules\esbuild\lib\main.js:578:7)
at Socket.emit (node:events:520:28)
at addChunk (node:internal/streams/readable:315:12) {
errors: [
{
detail: undefined,
location: null,
notes: [],
pluginName: '',
text: 'The entry point "C:/Users/raweber/Documents/GitHub/svelte-babylon/.vitebook/config.js" cannot be marked as external'
}
],
warnings: []
}
I will let you know as soon as I get an update. Sorry for the difficulties, yesterday I prepared vitebook locally to debug it myself. Might make things faster.