Comments (2)
Following
getting the same error for myself as well
Here is how i create the worker in my library (using comlink and the new URL
and import.meta.url)
const instance = new Worker(
new URL('./shared/decodeImageFrame.js', import.meta.url),
{ type: 'module' }
);
and here is my tsconfig for publishing with tsc
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"baseUrl": "./",
"checkJs": false,
"declaration": true,
"emitDeclarationOnly": false,
"isolatedModules": false,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"useDefineForClassFields": false,
"jsx": "react-jsx",
"lib": ["ES2022", "dom"],
"noImplicitAny": false,
"noImplicitThis": false,
"pretty": true,
"removeComments": true,
"skipLibCheck": true,
"strict": true,
"strictNullChecks": false,
"target": "ES2022",
"downlevelIteration": true,
"resolveJsonModule": true,
"module": "esnext", // esnext | commonjs
"moduleResolution": "node",
"outDir": "dist",
"sourceMap": true,
},
}
and here is my vite config in my app for consuming
import { defineConfig } from "vite"
import react from "@vitejs/plugin-react"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})
I tried various options like
worker: {
format: "es",
},
and using vite-comlink plugin
but no success
from vite.
Duplicate of #8427
from vite.
Related Issues (20)
- Unused import from external module prints massive indecipherable warning message HOT 4
- Support build multi-page-app to saparate dir HOT 1
- Dev server doesn't update overridden env var when doing an automatic reload. HOT 1
- ERR_HTTP_HEADERS_SENT with 5.3.0 / 5.3.1 and https-proxy-agent configured HOT 5
- vite build creates source folder in dist on certain imports HOT 1
- Http OPTIONS request doesn't work with Server Proxy HOT 3
- Vue3, Router4 problem when using externals
- CSS from entrypoints is not extracted correctly HOT 4
- Dynamic import of a peer dependency causes inconsistencies between dev and prod HOT 2
- Have plan to support MF2?
- Unclear configuration setup for bundling for non-browser environments HOT 7
- HMR won't work on vue files if import other packages which are in the same monorepo HOT 1
- Vite dev doesn't serve index.html from subdirectories of publicDir HOT 1
- RollupError: [type] is not exported by [file] - failure for relative imports of types HOT 2
- The page will automatically refresh after installing the plugin.prompt:optimized dependencies changed. reloading
- How to Resolve Browser Cache Invalidation Issue in Vite-React Project Deployment?
- FluentMaterial fails to compile via vite HOT 1
- JavaScript API InlineConfig Loader/Callback/Provider HOT 2
- Segmentation fault when building sveltekit library with dependency using FFI HOT 2
- Dynamic imports doesn't work after i upgraded to Vite 5.3.1 HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vite.