← Back to community index
# contributor·Active

0hmx - AI is doing this a lot## Browser Impor...

AI is doing this a lot Browser Import Error The error occurred because the AI used a directory import: code sample Node.js and Bun automatically resolve this to ./imports/index.ts, but the browser evaluator may not. Use an explicit path instead: code sample Or import the file dir

Started by 0hmxAug 7, 20263 messages

Discussion

Last active 28 days ago · plain text
0hmxoriginal post
AI is doing this a lot ## Browser Import Error The error occurred because the AI used a directory import: ```ts import { Part } from "./imports" ``` Node.js and Bun automatically resolve this to `./imports/index.ts`, but the browser evaluator may not. Use an explicit path instead: ```ts import { Part } from "./imports/index" ``` Or import the file directly: ```ts import { Part } from "./imports/Part" ``` The mistake was assuming all environments use Node-style import resolution. For reliable tscircuit code, idk what is the best
0hmx
because tsci build works with './imports' the ai can not see this error will happen in the browser. and './imports' will not work
0hmx
it has to give the full path

Want to add to the conversation?

Reply in Discord so your notes stay connected to the source.
Continue in Discord ↗