-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReferenceError: Can't find variable: process #1402
Comments
bug reproducedWhile trying to reproduce the bug in a test project, intelliSense just randomly imported
eslint only shows the warning:
In my project, however, I don't have a wrong import to blame 🤷♂️ |
@Conduitry does this clarify the problem enough? |
|
@babichjacob ithis is my test/bugreport project, created specifically to reproduce the problem LOL 😅: |
Hmm, I couldn't quite find the main issue for having more understandable error messages especially relating to situations like this, so I've reopened this. |
@babichjacob I have finally found the problem btw. It was inside of the one of shared classes (.ts) that I imported straight from the backend. It simply had some leftover debug-related code (checking process.env.debug flag). |
Describe the bug
After a few days of development on one single page (with many components) and building a production version (built version is working perfectly), I'm unable to open just this exact page in the
dev
mode only with following errors in any browser:Logs
Page itself:
From browser's console:
npm run dev or yarn dev show no errors at all.
Other pages are still working without a problem. Built project also works as intended with no errors.
From googling found pretty similar issue in vite's issues (but it was closed).
To Reproduce
My setup:
npm init svelte@next appName
typescript versionnpx svelte-add tailwindcss
npm install
,npm run dev
, write lots of code and some components postcss (tailwind) styling, etc.I'm terribly sorry, but I can't provide the exact code causing problems. If I'll be able to reproduce it with some example code later, I'll update this issue.
npm run build
oryarn build
– built website works like a charm. But after runningdev
again I start to see these errors 99% of times (in some rare occasions I'm still able to load the desired page correctly by randomly clicking back and forth between existing pages and refreshing the page).Expected behavior
I expected the page to work in dev mode.
Stacktraces
Terminal outputs no errors or warnings.
Information about your SvelteKit Installation:
Diagnostics
The output of
npx envinfo --system --npmPackages svelte,@sveltejs/kit,vite --binaries --browsers
System:
OS: macOS 10.15.7
CPU: (8) x64 Intel(R) Core(TM) i7-3635QM CPU @ 2.40GHz
Memory: 188.13 MB / 8.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 14.9.0 - ~/.volta/tools/image/node/14.9.0/bin/node
Yarn: 1.22.10 - ~/.volta/tools/image/yarn/1.22.10/bin/yarn
npm: 7.9.0 - ~/.volta/tools/image/npm/7.9.0/bin/npm
Browsers:
Chrome: 90.0.4430.93
Firefox: 88.0
Safari: 14.1
npmPackages:
@sveltejs/kit: next => 1.0.0-next.103
svelte: ^3.34.0 => 3.38.2
vite: ^2.2.3 => 2.2.4
Your browser
I've tried all of the above, from the system report.
Your adapter (e.g. Node, static, Vercel, Begin, etc...)
Problem doesn't appear with an adapter.
Severity
Just annoying. I hope I can help saving others from running into it.
Additional context
Since I can't provide the code, please suggest any actions or changes to make in order to find/fix the problem.
If there's no easy solution, I'll do my best to isolate the problem with a separate repository later on.
At the moment I doesn't have time to do so properly.
UPDATE: at the moment, the page successfully loads more often (with the same errors, but I'm at least is able to go around it and avoid them)
The text was updated successfully, but these errors were encountered: