I use AIStudio and all my efforts lately are to avoid major
refactors the inevitably generate an error of the type
“Uncaught TypeError: Failed to resolve module specifier “@/[more here] . Relative references must start with either “/”, “./”, or “../”.”
Invariably the path specified as @/… is not referenced in the app.
Trying to fix this issue has the AI go on a infinite hunt where nothing works – up to the point that it’s admitted to me the development environment it has access to is different than the preview environment.
From Gemini itself:
This error means the browser cannot find a module because its import statement uses a “bare specifier” instead of a relative or absolute path. To fix this, use a build tool like Webpack, Parcel, or Vite to bundle your code, or use import-maps to map bare specifiers to URLs. You can also try using a CDN to import the module directly in an <script type="module"> tag if it’s a third-party library.
Wonder if there is a simple solution (e.g. vite config) that everybody knows about that I don’t.