You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SyntaxError CLIENT Cannot declare a function that shadows a let/const/class/function variable 'i'. build/node_modules/brisa/jsx-runtime/index.js::1:0
#520
Open
swiftcoder opened this issue
Oct 6, 2024
· 4 comments
I'm not entirely sure how I'm triggering this, but it seems to occur after adding/removing a web component. Once I'm in this situation, build and start work fine, but the dev command fails every page load with some variation on the following:
$ brisa dev
[ info ] 🚀 Brisa 0.1.0: Running on Bun.js 1.1.29
[ wait ] starting the development server...
[ info ] ✓ Compiled successfully!
[ info ] compiled successfully in 753.64ms.
[ info ] hot reloading enabled
[ info ] listening on http://localhost:3000
[ error ] Ops! Error:
[ error ] --------------------------
[ error ] SyntaxError: Cannot declare a function that shadows a let/const/class/function variable 'i'.
at <parse> (/Users/tristam/projects/feersum-brisa/build/node_modules/brisa/jsx-runtime/index.js:2)
at <anonymous> (:11:43)
at processTicksAndRejections (:12:39)
Any pointers as to what I might be doing wrong? Is there a web-component cache I need to blow away?
The text was updated successfully, but these errors were encountered:
@swiftcoder Does it happen to you from the beginning when you initialize a project or has it happened to you afterwards? If the latter, could you share some code?
And what platform is your computer?
For MacOS and Linux: copy the output of uname -mprs
For Windows: copy the output of "$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })" in the PowerShell console
I figured out the issue eventually, by commenting out code till I isolated it. It looks like an incompatibility with trying to import from a library that does an export *
The easiest repro I have to hand is with THREE.js. If you add Three to your project and then try and import * as THREE from 'three'; or import { GLTFLoader } from "three/examples/jsm/Addons.js";, then brisa dev will choke.
Switching to the old require(...) syntax unbreaks it, as does importing inner modules (rather than the export * re-exports in the top-level files)
I'm not entirely sure how I'm triggering this, but it seems to occur after adding/removing a web component. Once I'm in this situation, build and start work fine, but the
dev
command fails every page load with some variation on the following:Any pointers as to what I might be doing wrong? Is there a web-component cache I need to blow away?
The text was updated successfully, but these errors were encountered: