__dirname Reference Error
See original GitHub issueDescribe the bug
Working with vite, react and deck.gl, my app which used to build and run fine with vite, now throws this error:
encode-texture.ts:3 Uncaught ReferenceError: __dirname is not defined
at encode-texture.ts:3
I am not sure what changed.
Using define doesn’t help.
Reproduction
Will do tomorrow
System Info
System:
OS: Linux 5.10 Ubuntu 20.04.3 LTS (Focal Fossa)
CPU: (8) x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
Memory: 1.33 GB / 50.15 GB
Container: Yes
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
Yarn: 3.1.0 - /mnt/c/Users/jesse/scoop/apps/nodejs-lts/current/bin/yarn
npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
npmPackages:
@vitejs/plugin-react-refresh: ~1.3.6 => 1.3.6
vite: ~2.6.14 => 2.6.14
### Used Package Manager
pnpm
### Logs
```shell
vite:time 2.50ms / +0ms
vite:spa-fallback Rewriting GET / to /index.html +0ms
vite:time 22.70ms /index.html +56ms
vite:resolve 2.73ms /@vite/client -> /home/jesse/dgts/common/temp/node_modules/.pnpm/vite@2.6.14/node_modules/vite/dist/client/client.mjs +0ms
vite:load 1.58ms [fs] /@vite/client +0ms
vite:resolve 0.64ms @vite/env -> /home/jesse/dgts/common/temp/node_modules/.pnpm/vite@2.6.14/node_modules/vite/dist/client/env.mjs +14ms
vite:import-analysis 4.53ms [1 imports rewritten] /home/jesse/dgts/common/temp/node_modules/.pnpm/vite@2.6.14/node_modules/vite/dist/client/client.mjs +0ms
vite:transform 8.44ms /@vite/client +0ms
vite:time 20.49ms /@vite/client +60ms
vite:load 1.38ms [fs] npm: .pnpm +16ms
vite:import-analysis 0.18ms [no imports] /home/jesse/dgts/common/temp/node_modules/.pnpm/vite@2.6.14/node_modules/vite/dist/client/env.mjs +7ms
vite:transform 0.98ms npm: .pnpm +7ms
vite:resolve 0.33ms /src/main.tsx -> /home/jesse/dgts/predators2/map-gl/src/main.tsx +9ms
vite:load 1.17ms [fs] /src/main.tsx +6ms
vite:load 0.02ms [plugin] /@react-refresh +224ms
vite:import-analysis 0.58ms [no imports] /@react-refresh +228ms
vite:transform 0.94ms /@react-refresh +228ms
vite:time 1.82ms /@react-refresh +233ms
vite:cache [memory] npm: .pnpm +0ms
vite:time 1.33ms npm: .pnpm +7ms
vite:resolve 0.19ms react -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/react.js?v=ebc8feb8&es-interop +238ms
vite:resolve 0.21ms /node_modules/.vite/react.js?v=ebc8feb8&es-interop -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/react.js?v=ebc8feb8&es-interop +0ms
vite:resolve 0.10ms react-dom -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/react-dom.js?v=ebc8feb8&es-interop +6ms
vite:resolve 0.20ms /node_modules/.vite/react-dom.js?v=ebc8feb8&es-interop -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/react-dom.js?v=ebc8feb8&es-interop +0ms
vite:resolve 0.51ms ./app -> /home/jesse/dgts/predators2/map-gl/src/app.tsx +2ms
vite:resolve 0.20ms /src/app.tsx -> /home/jesse/dgts/predators2/map-gl/src/app.tsx +0ms
vite:resolve 0.22ms /node_modules/.vite/react.js?v=ebc8feb8 -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/react.js?v=ebc8feb8 +1ms
vite:resolve 0.19ms /node_modules/.vite/react-dom.js?v=ebc8feb8 -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/react-dom.js?v=ebc8feb8 +0ms
vite:import-analysis 12.91ms [3 imports rewritten] src/main.tsx +21ms
vite:transform 246.80ms /src/main.tsx +22ms
vite:time 250.05ms /src/main.tsx +16ms
vite:load 1.20ms [fs] /node_modules/.vite/react.js?v=ebc8feb8 +26ms
vite:resolve 0.16ms ./chunk-CZOPDR6J.js -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/chunk-CZOPDR6J.js +7ms
vite:resolve 0.34ms /node_modules/.vite/chunk-CZOPDR6J.js?v=ebc8feb8 -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/chunk-CZOPDR6J.js?v=ebc8feb8 +1ms
vite:resolve 0.43ms ./chunk-Q22OBRQV.js -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/chunk-Q22OBRQV.js +1ms
vite:resolve 0.23ms /node_modules/.vite/chunk-Q22OBRQV.js?v=ebc8feb8 -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/chunk-Q22OBRQV.js?v=ebc8feb8 +1ms
vite:import-analysis 3.86ms [2 imports rewritten] node_modules/.vite/react.js?v=ebc8feb8 +9ms
vite:transform 4.59ms /node_modules/.vite/react.js?v=ebc8feb8 +9ms
vite:load 7.52ms [fs] /src/app.tsx +7ms
vite:load 150.13ms [fs] /node_modules/.vite/react-dom.js?v=ebc8feb8 +142ms
vite:import-analysis 15.50ms [2 imports rewritten] node_modules/.vite/react-dom.js?v=ebc8feb8 +181ms
vite:transform [reuse pending] for /node_modules/.vite/chunk-CZOPDR6J.js?v=ebc8feb8 +180ms
vite:transform [reuse pending] for /node_modules/.vite/chunk-Q22OBRQV.js?v=ebc8feb8 +0ms
vite:transform 16.18ms /node_modules/.vite/react-dom.js?v=ebc8feb8 +0ms
vite:cache [memory] /node_modules/.vite/react.js?v=ebc8feb8 +211ms
vite:time 0.99ms /node_modules/.vite/react.js?v=ebc8feb8 +194ms
vite:cache [memory] /node_modules/.vite/react-dom.js?v=ebc8feb8 +1ms
vite:time 22.57ms /node_modules/.vite/react-dom.js?v=ebc8feb8 +23ms
vite:transform [reuse pending] for /node_modules/.vite/chunk-CZOPDR6J.js?v=ebc8feb8 +53ms
vite:transform [reuse pending] for /src/app.tsx +1ms
vite:load 234.13ms [fs] /node_modules/.vite/chunk-CZOPDR6J.js?v=ebc8feb8 +91ms
vite:import-analysis 2.87ms [1 imports rewritten] node_modules/.vite/chunk-CZOPDR6J.js?v=ebc8feb8 +60ms
vite:transform [reuse pending] for /node_modules/.vite/chunk-Q22OBRQV.js?v=ebc8feb8 +6ms
vite:transform 3.61ms /node_modules/.vite/chunk-CZOPDR6J.js?v=ebc8feb8 +0ms
vite:time 12.02ms /node_modules/.vite/chunk-CZOPDR6J.js?v=ebc8feb8 +36ms
vite:load 249.10ms [fs] /node_modules/.vite/chunk-Q22OBRQV.js?v=ebc8feb8 +17ms
vite:import-analysis 0.10ms [no imports] node_modules/.vite/chunk-Q22OBRQV.js?v=ebc8feb8 +11ms
vite:transform 0.50ms /node_modules/.vite/chunk-Q22OBRQV.js?v=ebc8feb8 +12ms
vite:resolve 0.10ms @deck.gl/geo-layers -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/@deck_gl_geo-layers.js?v=ebc8feb8 +257ms
vite:resolve 0.20ms /node_modules/.vite/@deck_gl_geo-layers.js?v=ebc8feb8 -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/@deck_gl_geo-layers.js?v=ebc8feb8 +0ms
vite:resolve 0.06ms @deck.gl/layers -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/@deck_gl_layers.js?v=ebc8feb8 +1ms
vite:resolve 0.18ms /node_modules/.vite/@deck_gl_layers.js?v=ebc8feb8 -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/@deck_gl_layers.js?v=ebc8feb8 +0ms
vite:resolve 0.08ms @deck.gl/react -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/@deck_gl_react.js?v=ebc8feb8 +1ms
vite:resolve 0.23ms /node_modules/.vite/@deck_gl_react.js?v=ebc8feb8 -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/@deck_gl_react.js?v=ebc8feb8 +0ms
vite:resolve 0.08ms react-map-gl -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/react-map-gl.js?v=ebc8feb8 +6ms
vite:resolve 4.33ms /node_modules/.vite/react-map-gl.js?v=ebc8feb8 -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/react-map-gl.js?v=ebc8feb8 +5ms
vite:resolve 0.50ms ./dev/data -> /home/jesse/dgts/predators2/map-gl/src/dev/data.ts +1ms
vite:resolve 0.16ms /src/dev/data.ts -> /home/jesse/dgts/predators2/map-gl/src/dev/data.ts +0ms
vite:resolve 0.41ms ./dev/local-style -> /home/jesse/dgts/predators2/map-gl/src/dev/local-style.ts +1ms
vite:resolve 0.17ms /src/dev/local-style.ts -> /home/jesse/dgts/predators2/map-gl/src/dev/local-style.ts +0ms
vite:resolve 0.55ms ./map-marker -> /home/jesse/dgts/predators2/map-gl/src/map-marker.tsx +1ms
vite:resolve 0.18ms /src/map-marker.tsx -> /home/jesse/dgts/predators2/map-gl/src/map-marker.tsx +0ms
vite:resolve 0.42ms ./mapbox-token -> /home/jesse/dgts/predators2/map-gl/src/mapbox-token.ts +1ms
vite:resolve 0.16ms /src/mapbox-token.ts -> /home/jesse/dgts/predators2/map-gl/src/mapbox-token.ts +0ms
vite:resolve 0.44ms ./utils -> /home/jesse/dgts/predators2/map-gl/src/utils.ts +1ms
vite:resolve 0.18ms /src/utils.ts -> /home/jesse/dgts/predators2/map-gl/src/utils.ts +0ms
vite:resolve 0.06ms swr -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/swr.js?v=ebc8feb8 +0ms
vite:resolve 0.18ms /node_modules/.vite/swr.js?v=ebc8feb8 -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/swr.js?v=ebc8feb8 +1ms
vite:resolve 0.17ms ./index.css -> /home/jesse/dgts/predators2/map-gl/src/index.css +0ms
vite:resolve 0.16ms /src/index.css -> /home/jesse/dgts/predators2/map-gl/src/index.css +0ms
vite:hmr [self-accepts] src/app.tsx +0ms
vite:import-analysis 25.70ms [13 imports rewritten] src/app.tsx +28ms
vite:transform 314.30ms /src/app.tsx +63ms
vite:cache [memory] /@react-refresh +131ms
vite:cache [memory] /node_modules/.vite/react.js?v=ebc8feb8 +1ms
vite:cache [memory] /node_modules/.vite/chunk-Q22OBRQV.js?v=ebc8feb8 +4ms
vite:time 0.50ms /node_modules/.vite/chunk-Q22OBRQV.js?v=ebc8feb8 +79ms
vite:load 8.16ms [fs] /node_modules/.vite/@deck_gl_layers.js?v=ebc8feb8 +79ms
vite:resolve 0.10ms ./chunk-W3HUTNHK.js -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/chunk-W3HUTNHK.js +56ms
vite:resolve 0.08ms /node_modules/.vite/chunk-W3HUTNHK.js?v=ebc8feb8 -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/chunk-W3HUTNHK.js?v=ebc8feb8 +0ms
vite:resolve 0.23ms ./chunk-UKUXLBKO.js -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/chunk-UKUXLBKO.js +2ms
vite:resolve 0.17ms /node_modules/.vite/chunk-UKUXLBKO.js?v=ebc8feb8 -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/chunk-UKUXLBKO.js?v=ebc8feb8 +0ms
vite:resolve 1.79ms ./chunk-PYMFFKJS.js -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/chunk-PYMFFKJS.js +2ms
vite:resolve 0.45ms /node_modules/.vite/chunk-PYMFFKJS.js?v=ebc8feb8 -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/chunk-PYMFFKJS.js?v=ebc8feb8 +1ms
vite:import-analysis 7.58ms [4 imports rewritten] node_modules/.vite/@deck_gl_layers.js?v=ebc8feb8 +59ms
vite:transform 8.22ms /node_modules/.vite/@deck_gl_layers.js?v=ebc8feb8 +23ms
vite:cache [memory] /node_modules/.vite/chunk-Q22OBRQV.js?v=ebc8feb8 +16ms
vite:load 18.05ms [fs] /node_modules/.vite/@deck_gl_react.js?v=ebc8feb8 +10ms
vite:resolve 0.18ms ./chunk-I5ZREPYC.js -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/chunk-I5ZREPYC.js +6ms
vite:resolve 0.18ms /node_modules/.vite/chunk-I5ZREPYC.js?v=ebc8feb8 -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/chunk-I5ZREPYC.js?v=ebc8feb8 +1ms
vite:import-analysis 7.80ms [5 imports rewritten] node_modules/.vite/@deck_gl_react.js?v=ebc8feb8 +10ms
vite:transform [reuse pending] for /node_modules/.vite/chunk-UKUXLBKO.js?v=ebc8feb8 +11ms
vite:transform [reuse pending] for /node_modules/.vite/chunk-PYMFFKJS.js?v=ebc8feb8 +0ms
vite:transform 8.44ms /node_modules/.vite/@deck_gl_react.js?v=ebc8feb8 +0ms
vite:cache [memory] /node_modules/.vite/chunk-CZOPDR6J.js?v=ebc8feb8 +11ms
vite:cache [memory] /node_modules/.vite/chunk-Q22OBRQV.js?v=ebc8feb8 +0ms
vite:load 29.40ms [fs] /src/dev/data.ts +11ms
vite:load 30.10ms [fs] /src/dev/local-style.ts +1ms
vite:load 30.65ms [fs] /src/map-marker.tsx +0ms
vite:load 84.94ms [fs] /src/mapbox-token.ts +54ms
vite:load 85.26ms [fs] /src/utils.ts +1ms
vite:load 85.55ms [fs] /node_modules/.vite/swr.js?v=ebc8feb8 +0ms
vite:import-analysis 1.74ms [2 imports rewritten] node_modules/.vite/swr.js?v=ebc8feb8 +62ms
vite:transform 2.19ms /node_modules/.vite/swr.js?v=ebc8feb8 +61ms
vite:cache [memory] /node_modules/.vite/chunk-CZOPDR6J.js?v=ebc8feb8 +60ms
vite:cache [memory] /node_modules/.vite/chunk-Q22OBRQV.js?v=ebc8feb8 +0ms
vite:load 88.85ms [fs] /src/index.css +4ms
vite:time 180.12ms /src/app.tsx +90ms
vite:load 93.36ms [fs] /node_modules/.vite/@deck_gl_geo-layers.js?v=ebc8feb8 +4ms
vite:import-analysis 18.64ms [4 imports rewritten] node_modules/.vite/@deck_gl_geo-layers.js?v=ebc8feb8 +48ms
vite:transform [reuse pending] for /node_modules/.vite/chunk-W3HUTNHK.js?v=ebc8feb8 +49ms
vite:transform [reuse pending] for /node_modules/.vite/chunk-UKUXLBKO.js?v=ebc8feb8 +0ms
vite:transform [reuse pending] for /node_modules/.vite/chunk-PYMFFKJS.js?v=ebc8feb8 +0ms
vite:transform 19.37ms /node_modules/.vite/@deck_gl_geo-layers.js?v=ebc8feb8 +0ms
vite:cache [memory] /node_modules/.vite/chunk-Q22OBRQV.js?v=ebc8feb8 +52ms
vite:cache [memory] /node_modules/.vite/@deck_gl_geo-layers.js?v=ebc8feb8 +6ms
vite:time 26.73ms /node_modules/.vite/@deck_gl_geo-layers.js?v=ebc8feb8 +80ms
vite:cache [memory] /node_modules/.vite/@deck_gl_layers.js?v=ebc8feb8 +40ms
vite:time 0.82ms /node_modules/.vite/@deck_gl_layers.js?v=ebc8feb8 +14ms
vite:cache [memory] /node_modules/.vite/@deck_gl_react.js?v=ebc8feb8 +2ms
vite:time 2.96ms /node_modules/.vite/@deck_gl_react.js?v=ebc8feb8 +4ms
vite:load 191.67ms [fs] /node_modules/.vite/react-map-gl.js?v=ebc8feb8 +98ms
vite:import-analysis 20.74ms [4 imports rewritten] node_modules/.vite/react-map-gl.js?v=ebc8feb8 +159ms
vite:transform [reuse pending] for /node_modules/.vite/chunk-I5ZREPYC.js?v=ebc8feb8 +158ms
vite:transform [reuse pending] for /node_modules/.vite/chunk-PYMFFKJS.js?v=ebc8feb8 +0ms
vite:transform 21.61ms /node_modules/.vite/react-map-gl.js?v=ebc8feb8 +0ms
vite:cache [memory] /node_modules/.vite/chunk-CZOPDR6J.js?v=ebc8feb8 +110ms
vite:cache [memory] /node_modules/.vite/chunk-Q22OBRQV.js?v=ebc8feb8 +0ms
vite:import-analysis 0.09ms [no imports] src/mapbox-token.ts +7ms
vite:import-analysis 0.45ms [no imports] src/utils.ts +0ms
vite:import-analysis 0.60ms [no imports] src/dev/data.ts +0ms
vite:transform 217.90ms /src/mapbox-token.ts +8ms
vite:transform 217.74ms /src/utils.ts +0ms
vite:transform 273.44ms /src/dev/data.ts +0ms
vite:resolve 1.02ms ./map-styles/maptiler/style -> /home/jesse/dgts/predators2/map-gl/src/dev/map-styles/maptiler/style.ts +282ms
vite:resolve 0.33ms /src/dev/map-styles/maptiler/style.ts -> /home/jesse/dgts/predators2/map-gl/src/dev/map-styles/maptiler/style.ts +1ms
vite:import-analysis 4.03ms [1 imports rewritten] src/dev/local-style.ts +4ms
vite:transform 275.96ms /src/dev/local-style.ts +3ms
vite:resolve 2.20ms @predators2/utils -> /home/jesse/dgts/predators2/utils/dist/esm/index.js +4ms
vite:resolve 0.25ms ./svg-icons -> /home/jesse/dgts/predators2/map-gl/src/svg-icons.tsx +1ms
vite:resolve 0.09ms /src/svg-icons.tsx -> /home/jesse/dgts/predators2/map-gl/src/svg-icons.tsx +0ms
vite:hmr [detected api usage] src/map-marker.tsx +356ms
vite:import-analysis 8.32ms [5 imports rewritten] src/map-marker.tsx +4ms
vite:transform 299.09ms /src/map-marker.tsx +24ms
vite:cache [memory] /@react-refresh +32ms
vite:cache [memory] /node_modules/.vite/react.js?v=ebc8feb8 +0ms
vite:cache [memory] /node_modules/.vite/react-map-gl.js?v=ebc8feb8 +0ms
vite:load 313.78ms [fs] /node_modules/.vite/chunk-W3HUTNHK.js?v=ebc8feb8 +140ms
vite:import-analysis 4.06ms [3 imports rewritten] node_modules/.vite/chunk-W3HUTNHK.js?v=ebc8feb8 +30ms
vite:transform [reuse pending] for /node_modules/.vite/chunk-UKUXLBKO.js?v=ebc8feb8 +10ms
vite:transform [reuse pending] for /node_modules/.vite/chunk-PYMFFKJS.js?v=ebc8feb8 +0ms
vite:transform 4.46ms /node_modules/.vite/chunk-W3HUTNHK.js?v=ebc8feb8 +0ms
vite:cache [memory] /node_modules/.vite/chunk-Q22OBRQV.js?v=ebc8feb8 +10ms
vite:load 312.67ms [fs] /node_modules/.vite/chunk-I5ZREPYC.js?v=ebc8feb8 +10ms
vite:import-analysis 1.26ms [2 imports rewritten] node_modules/.vite/chunk-I5ZREPYC.js?v=ebc8feb8 +3ms
vite:transform 1.54ms /node_modules/.vite/chunk-I5ZREPYC.js?v=ebc8feb8 +3ms
vite:cache [memory] /node_modules/.vite/chunk-CZOPDR6J.js?v=ebc8feb8 +3ms
vite:cache [memory] /node_modules/.vite/chunk-Q22OBRQV.js?v=ebc8feb8 +0ms
vite:load 326.94ms [fs] /node_modules/.vite/chunk-PYMFFKJS.js?v=ebc8feb8 +3ms
vite:import-analysis 2.17ms [1 imports rewritten] node_modules/.vite/chunk-PYMFFKJS.js?v=ebc8feb8 +8ms
vite:transform 2.43ms /node_modules/.vite/chunk-PYMFFKJS.js?v=ebc8feb8 +8ms
vite:cache [memory] /node_modules/.vite/chunk-Q22OBRQV.js?v=ebc8feb8 +8ms
vite:cache [memory] /node_modules/.vite/react-map-gl.js?v=ebc8feb8 +1ms
vite:time 36.82ms /node_modules/.vite/react-map-gl.js?v=ebc8feb8 +199ms
vite:cache [memory] /src/dev/data.ts +86ms
vite:time 3.97ms /src/dev/data.ts +49ms
vite:cache [memory] /src/dev/local-style.ts +1ms
vite:time 0.72ms /src/dev/local-style.ts +1ms
vite:load 422.82ms [fs] /node_modules/.vite/chunk-UKUXLBKO.js?v=ebc8feb8 +96ms
vite:import-analysis 16.88ms [2 imports rewritten] node_modules/.vite/chunk-UKUXLBKO.js?v=ebc8feb8 +141ms
vite:transform 17.33ms /node_modules/.vite/chunk-UKUXLBKO.js?v=ebc8feb8 +141ms
vite:cache [memory] /node_modules/.vite/chunk-PYMFFKJS.js?v=ebc8feb8 +55ms
vite:cache [memory] /node_modules/.vite/chunk-Q22OBRQV.js?v=ebc8feb8 +0ms
vite:transform [reuse pending] for /src/map-marker.tsx +7ms
vite:cache [memory] /src/mapbox-token.ts +6ms
vite:time 0.65ms /src/mapbox-token.ts +62ms
vite:load 194.79ms [fs] /src/dev/map-styles/maptiler/style.ts +61ms
vite:load 171.35ms [fs] ../utils/dist/esm/index.js +1ms
vite:resolve 0.45ms ./lat-lon -> /home/jesse/dgts/predators2/utils/dist/esm/lat-lon.js +196ms
vite:import-analysis 1.19ms [1 imports rewritten] /home/jesse/dgts/predators2/utils/dist/esm/index.js +13ms
vite:transform 1.55ms ../utils/dist/esm/index.js +7ms
vite:load 175.62ms [fs] /src/svg-icons.tsx +4ms
vite:time 124.78ms /src/map-marker.tsx +123ms
vite:cache [memory] /src/utils.ts +126ms
vite:time 1.42ms /src/utils.ts +3ms
vite:cache [memory] /node_modules/.vite/swr.js?v=ebc8feb8 +4ms
vite:time 2.78ms /node_modules/.vite/swr.js?v=ebc8feb8 +4ms
vite:hmr [self-accepts] src/svg-icons.tsx +325ms
vite:import-analysis 2.16ms [2 imports rewritten] src/svg-icons.tsx +131ms
vite:transform 150.01ms /src/svg-icons.tsx +151ms
vite:cache [memory] /@react-refresh +27ms
vite:cache [memory] /node_modules/.vite/react.js?v=ebc8feb8 +0ms
vite:load 151.36ms [fs] ../utils/dist/esm/lat-lon.js +151ms
vite:import-analysis 0.08ms [no imports] /home/jesse/dgts/predators2/utils/dist/esm/lat-lon.js +23ms
vite:transform 0.34ms ../utils/dist/esm/lat-lon.js +2ms
vite:resolve 0.14ms /tailwind.config.js -> /home/jesse/dgts/predators2/map-gl/tailwind.config.js +4s
vite:hmr [self-accepts] src/index.css +4s
vite:import-analysis 21.59ms [0 imports rewritten] src/index.css +4s
vite:transform 4834.54ms /src/index.css +4s
vite:resolve 0.26ms ./tiles -> /home/jesse/dgts/predators2/map-gl/src/dev/map-styles/maptiler/tiles.ts +55ms
vite:resolve 0.08ms /src/dev/map-styles/maptiler/tiles.ts -> /home/jesse/dgts/predators2/map-gl/src/dev/map-styles/maptiler/tiles.ts +1ms
vite:import-analysis 1.22ms [1 imports rewritten] src/dev/map-styles/maptiler/style.ts +16ms
vite:transform 4437.77ms /src/dev/map-styles/maptiler/style.ts +16ms
vite:cache [memory] /src/index.css +4s
vite:time 0.50ms /src/index.css +4s
vite:cache [memory] /node_modules/.vite/chunk-W3HUTNHK.js?v=ebc8feb8 +8ms
vite:time 14.88ms /node_modules/.vite/chunk-W3HUTNHK.js?v=ebc8feb8 +22ms
vite:cache [memory] /node_modules/.vite/chunk-UKUXLBKO.js?v=ebc8feb8 +21ms
vite:time 66.51ms /node_modules/.vite/chunk-UKUXLBKO.js?v=ebc8feb8 +73ms
vite:cache [memory] /node_modules/.vite/chunk-I5ZREPYC.js?v=ebc8feb8 +100ms
vite:time 1.23ms /node_modules/.vite/chunk-I5ZREPYC.js?v=ebc8feb8 +34ms
vite:cache [memory] /node_modules/.vite/chunk-PYMFFKJS.js?v=ebc8feb8 +2ms
vite:time 7.45ms /node_modules/.vite/chunk-PYMFFKJS.js?v=ebc8feb8 +9ms
vite:load 150.40ms [fs] /src/dev/map-styles/maptiler/tiles.ts +4s
vite:import-analysis 0.24ms [no imports] src/dev/map-styles/maptiler/tiles.ts +158ms
vite:transform 6.39ms /src/dev/map-styles/maptiler/tiles.ts +158ms
vite:cache [memory] /src/dev/map-styles/maptiler/style.ts +55ms
vite:time 1.10ms /src/dev/map-styles/maptiler/style.ts +49ms
vite:cache [memory] ../utils/dist/esm/index.js +6ms
vite:time 0.79ms ../utils/dist/esm/index.js +5ms
vite:cache [memory] /src/svg-icons.tsx +19ms
vite:time 0.68ms /src/svg-icons.tsx +19ms
vite:cache [memory] ../utils/dist/esm/lat-lon.js +3ms
vite:time 0.99ms ../utils/dist/esm/lat-lon.js +3ms
vite:cache [memory] /src/dev/map-styles/maptiler/tiles.ts +7ms
vite:time 0.88ms /src/dev/map-styles/maptiler/tiles.ts +8ms
vite:resolve 0.17ms /node_modules/.vite/chunk-Q22OBRQV.js -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/chunk-Q22OBRQV.js +770ms
vite:time 3.41ms /node_modules/.vite/chunk-Q22OBRQV.js.map +549ms
vite:resolve 0.30ms /node_modules/.vite/@deck_gl_layers.js -> /home/jesse/dgts/predators2/map-gl/node_modules/.vite/@deck_gl_layers.js +194ms
vite:time 1.76ms /node_modules/.vite/@deck_gl_layers.js.map +192ms
### Validations
- [X] Follow our [Code of Conduct](https://github.com/vitejs/vite/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://vitejs.dev/guide).
- [X] Check that there isn't [already an issue](https://github.com/vitejs/vite/issues) that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vitejs/vite/discussions) or join our [Discord Chat Server](https://chat.vitejs.dev/).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Why is __dirname not defined in node REPL? - Stack Overflow
__dirname is only defined in scripts. It's not available in REPL. try make a script a.js console.log(__dirname);. and run it: node a.js.
Read more >Fix "__dirname is not defined in ES module scope" in JS
To solve the "__dirname is not defined in ES module scope" error, import and use the dirname() method from the path module. The...
Read more >Fix "__dirname is not defined in ES module scope" in ...
One error you'll likely run into is "Uncaught ReferenceError: __dirname is not defined in ES module scope". This error is exactly what it ......
Read more >__dirname is not defined · Issue #2907 · nodejs/help · GitHub
I wrote a simple program: console.log('Hello world'); console.log(__dirname); Error: Hello world file:///C:/prj/akb48teamsh/html/t.js:2 ...
Read more >How to fix "__dirname is not defined in ES module scope"
I stumbled on this error while I used __dirname inside a ES module. In an ES module, you cannot use __dirname . Using...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@varna @Niputi thanks for the update(s). works for me now!
might take a look at the reproduction when I have gotten home