Hi, I am working on a svelteJS project using svelte/kit.
I am getting the following error while using the svelte-speech-recognition package:
Cannot find module '$app/env'
imported from '$LOCAL_PATH/node_modules/svelte-speech-recognition/SpeechRecognition.js'
I fixed the issue locally by changing a couple of lines in the following files:
In file svelte-speech-recognition/NativeSpeechRecognition.js I have changed line number 1from
import { browser } from "$app/env";
to
import { browser } from "$app/environment";
and in file svelte-speech-recognition/SpeechRecognition.js I have changed line number 3 in the same way.
This fixed my issue and everything started to work smoothly. I am using "@sveltejs/kit": "^2.5.18" and I am new to the SvelteJS world, so, I am not sure if the issue is with me or indeed there is the issue with the package.
If it is the second one, let me know and I can open a PR with the fix, otherwise, if anyone can help me find the real issue I would be glad, because indeed modifying the library under node_modules folder is not best practice 😄.
Description
Hi, I am working on a svelteJS project using svelte/kit.
I am getting the following error while using the
svelte-speech-recognition
package:I fixed the issue locally by changing a couple of lines in the following files:
In file
svelte-speech-recognition/NativeSpeechRecognition.js
I have changed line number 1 fromto
and in file
svelte-speech-recognition/SpeechRecognition.js
I have changed line number 3 in the same way.This fixed my issue and everything started to work smoothly. I am using
"@sveltejs/kit": "^2.5.18"
and I am new to the SvelteJS world, so, I am not sure if the issue is with me or indeed there is the issue with the package.If it is the second one, let me know and I can open a PR with the fix, otherwise, if anyone can help me find the real issue I would be glad, because indeed modifying the library under node_modules folder is not best practice 😄.