In gleam it's entirely possible to have modules and functions that use names that would be reserved in javascript. Eg you can have a function called new even though new is a javascript keyword. This is possible because the gleam compiler will actually name the function new$ when emitting js.
Lustre's build tooling doesn't currently take this into account.
✅ Project compiled successfully
✅ Esbuild installed!
❌ Bundling with esbuild
I ran into an error while trying to create a bundle with esbuild:
✘ [ERROR] No matching export in "build/dev/javascript/shared/shared/components/counter.mjs" for import "new"
build/.lustre/entry.mjs:2:24:
2 │ import { name, new as component } from '../dev/javascript/...
│ ~~~
╵ new$
Did you mean to import "new$" instead?
build/dev/javascript/shared/shared/components/counter.mjs:70:16:
70 │ export function new$() {
╵ ~~~~
1 error
In gleam it's entirely possible to have modules and functions that use names that would be reserved in javascript. Eg you can have a function called
new
even thoughnew
is a javascript keyword. This is possible because the gleam compiler will actually name the functionnew$
when emitting js.Lustre's build tooling doesn't currently take this into account.