-
-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReferenceError: importScripts is not defined when using await import #478
Comments
Get this after externalize it by new ExternalsPlugin({
type: 'commonjs',
// use regex works.
include: /@tiddlygit\+tiddlywiki@(.+)|llama-node(.+)|@llama-node(.+)/,
// when using npm, we can use this. But with pnpm, this won't work ↓
// include: path.join(__dirname, 'node_modules', '.pnpm', '@tiddlygit', 'tiddlywiki'),
}),
new ThreadsPlugin({
target: 'electron-node-worker',
plugins: ['ExternalsPlugin'],
}),
|
This works const { LLM } = await import('llama-node');
const { LLamaCpp } = await import('llama-node/dist/llm/llama-cpp.cjs'); with declare module 'llama-node/dist/llm/llama-cpp.cjs' {
export { LLamaCpp } from 'llama-node/dist/llm/llama-cpp';
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I always get #461 for a worker, I think is is due to fail to import some deps, so I use dynamic import instead for a try
And I get
importScripts is not defined
related compiled code
The text was updated successfully, but these errors were encountered: