StoicBuilder

HandbookI the LudusImports and modules

Ithe Ludus, Read code

Imports and modules

1 min readUpdated 28 November

In plain words

Each file in your project is a module that can export code, and other files import it by name instead of copying it.

Where you see it

The first few lines of almost every file. import { createClient } from "@supabase/supabase-js" pulls in an installed package, while import NoteCard from "./NoteCard" pulls in a file from the same folder.

src/pages/Notes.tsxbrowser
import { useState } from "react"; // a packageimport { supabase } from "@/lib/supabase"; // your own fileimport NoteCard from "./NoteCard"; // a default export export default function Notes() { // ...}
Packages have bare names. Your own files start with ./ or an alias such as @/.

What goes wrong

  1. Importing a package that was never installed

    The agent writes the import but never adds the package, and the preview fails with "Failed to resolve import" or "Cannot find module".

  2. Curly braces in the wrong place

    import Button from and import { Button } from ask for different things. A default export takes no braces; a named export needs them.

  3. Old paths after a file moves

    The agent moves a component into a new folder and misses an import that still points at the old path. The build breaks on a page you didn't touch.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
For every import you add, confirm the package is listed in package.json or the file exists at that path. Tell me which new packages you installed and why each one is needed.

Quick check

Sign in to earn +10 XP for it

After the agent adds a date picker, the preview shows "Failed to resolve import 'react-day-picker'". What went wrong?

Got a prompt that touches imports and modules?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.