Closed ShulkMaster closed 2 years ago
Hi @ShulkMaster and thanks for opening this issue. Unfortunately though, I'm afraid it's not related to this plugin since as you've said:
even when not adding glsl to the plugin array still show the same issue.
I think it's more similar to one of these:
Anyway, I've tested your repo and it works for me (also Windows 10, but node v16.15.1
).
If you don't want to upgrade node, I think you can firstly try to rename svelte.config.js
to svelte.config.mjs
, and then add "moduleResolution": "node"
to the compilerOptions
in your tsconfig.json
. I was facing another error (may be related to yours?) when running yarn dev
, but these 2 small updates fixed that.
As described in here, you can use "type": "module"
in you package.json
, but in that case, you'll also need to update vite.config.ts
in this way:
import { defineConfig } from 'vite'
import glsl from 'vite-plugin-glsl';
import { svelte } from '@sveltejs/vite-plugin-svelte'
export default defineConfig({
plugins: [svelte(), glsl.default()]
});
I hope that helps you. Please let me know if you've had any progress with this and thanks for your ⭐!
Cheers!
Hi. thank you very much for taking the time and help me. 😊 I really appreciate it.
I was triying to keep the same version of node if possible so I try your suggestions about using svelte.config.mjs
and "moduleResolution": "node"
as well a a few other tricks but as you point out this it's not related to this plugin. In fact it is an issue whit vite itselft since Vite version 3 uses node: import
which is supported in v16.0.0+ and v14.18.0+
I update to node 16+ so now it work fine.
Here is the comment where I found exactly what was happening liana-p coment
In case somebody else has this issue and needs to keep on node 14.x probably they what to stick with node v14.18.0 instead of 16 as I did.
Now I can continue in my journey with svelte and WebGL thank a lot.
Yeah, exactly. I've also noticed (just a few hours ago) that vite v3.0.0
was release and this is a breaking change. Just wanted to let you know I'm working on a new version to handle this update properly.
Hi I'm using this plugin in a newly created project wit svelte and typescript however I'm getting this error:
Checking if the is anybody that can help me? 👀
🔗 Link of my repo with issues in case someone wants to test
The project is basically what you get when running:
and filling for svelte and typescript
Node version v14.17.5 in a Windows 10 machine.
I did see #13 another issue with similar conditions ( svelte and node v14.17) however the error is different and already try removing the
from the packaje json. Also Package.json
event when not adding glsl to the plugin array still show the same issue.
also try to change the tsconfig.json
from
to
but the same issue appears. Sorry for the long text but I tried to provide as much details as possible 😥