Typescript / Parcel "Cannot find module"

83 views Asked by At

I'm using Parcel, NPM, and Typescript to develop a client-side JS applet. When I try to view my Parcel'd website (which I have on a local server) I get the error Uncaught Error: Cannot find module '5Y6Sf' Some debugging indicates that this issue is this line of code import {update, W_LIMIT} from "./edit"; edit.ts is a typescript file which contains (among others) I'm pretty sure 5Y5Sf is a name Parcel made for the module compiled from edit.ts but that's as far as I've gotten.

export let W_LIMIT = 800;

export function update(){
    window.system.set_rule();
    window.system.regenerate();
    resume();
    if ($("#display-rule-panel").is(":visible")){
        updateRuleVis();
    }
    render();
}

I've checked for circular dependencies and found none, and I don't get any compile errors. NPM dependenceies

  "devDependencies": {
    "@types/file-saver": "^2.0.7",
    "@types/jquery": "^3.5.29",
    "@types/seedrandom": "^3.0.2",
    "@types/three": "^0.160.0",
    "buffer": "^6.0.3",
    "http-server": "^14.1.1",
    "parcel": "^2.11.0",
    "typescript": "^5.3.3"
  },
  "dependencies": {
    "@svgdotjs/svg.js": "^3.2.0",
    "chance": "^1.1.11",
    "cytoscape": "^3.28.1",
    "file-saver": "^2.0.5",
    "jquery": "^3.7.1",
    "jszip": "^3.10.1",
    "seedrandom": "3.0.5",
    "three": "^0.160.0",
    "webgl": "^0.0.7"
  }

My tsconfig.json

{
  "compilerOptions": {
    "module": "es6",
    "target": "es2017",
    "sourceMap": true,
    "skipLibCheck": true,
    "moduleResolution": "Node",
    "lib": [
      "es2017",
      "dom",
      "scripthost"
//      "webworker"
    ],
    "outDir": "build",
    "allowSyntheticDefaultImports": true
  },
  "exclude": [
    "node_modules"
  ],
  "include": [
    "src/*.ts"
  ]
}

I would like the browser to be able to find the module, or failing that give an error I can work with. I've tried searching for similar errors on the internet and found nothing.

0

There are 0 answers