Debdut / browser-extension

Browser Extension Template with ESbuild builds, support for React, Preact, Typescript, Tailwind, Manifest V3/V2 support and multi browser build including Chrome, Firefox, Safari, Edge, Brave.
MIT License
677 stars 51 forks source link

ERR_UNKNOWN_FILE_EXTENSION #20

Open HarshdipD opened 1 year ago

HarshdipD commented 1 year ago

Just installed the template, and run npm install. I'm receiving the following error upon start or build. Not sure what's causing it, I have everything installed and have build Chrome extensions on my machine separately with React and TS.

 npm run build chrome

> browser-extension@2.0.0 build
> ts-node-esm scripts/build.ts chrome

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /<project-path>/scripts/build.ts
    at new NodeError (node:internal/errors:405:5)
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:99:9)
    at defaultGetFormat (node:internal/modules/esm/get_format:142:36)
    at defaultLoad (node:internal/modules/esm/load:91:20)
    at nextLoad (node:internal/modules/esm/hooks:733:28)
    at load (/Users/deogan/Documents/leetcode-hinter/node_modules/ts-node/dist/child/child-loader.js:19:122)
    at nextLoad (node:internal/modules/esm/hooks:733:28)
    at Hooks.load (node:internal/modules/esm/hooks:377:26)
    at MessagePort.handleMessage (node:internal/modules/esm/worker:168:24)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:778:20) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
pboymt commented 1 year ago

same problem

pesonn commented 1 year ago

This worked for me: https://github.com/Debdut/browser-extension/pull/19