-
Notifications
You must be signed in to change notification settings - Fork 4
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
Problem that cannot be imported after installation #25
Comments
Can you post your |
{
"name": "vite-electron-builder",
"description": "Secure boilerplate for Electron app based on Vite",
"version": "1.0.2",
"private": true,
"author": {
"email": "kozackunisoft@gmail.com",
"name": "Alex Kozack",
"url": "https://kozack.me"
},
"type": "module",
"main": "packages/main/dist/index.cjs",
"scripts": {
"build": "npm run build:main && npm run build:preload && npm run build:renderer",
"build:main": "cd ./packages/main && vite build",
"build:preload": "cd ./packages/preload && vite build",
"build:renderer": "vite build",
"compile": "cross-env MODE=production npm run build && electron-builder build --config .electron-builder.config.cjs --dir --config.asar=false",
"test": "npm run test:main && npm run test:preload && npm run test:renderer && npm run test:e2e",
"test:e2e": "npm run build && vitest run",
"test:main": "vitest run -r packages/main --passWithNoTests",
"test:preload": "vitest run -r packages/preload --passWithNoTests",
"test:renderer": "vitest run --passWithNoTests --config src/vitest.config.cjs",
"watch": "node scripts/watch.mjs",
"lint": "eslint . --ext js,mjs,cjs,ts,mts,cts,svelte",
"typecheck:main": "tsc --noEmit -p packages/main/tsconfig.json",
"typecheck:preload": "tsc --noEmit -p packages/preload/tsconfig.json",
"typecheck:renderer": "tsc --noEmit",
"typecheck": "npm run typecheck:main && npm run typecheck:preload && npm run typecheck:renderer",
"postinstall": "cross-env ELECTRON_RUN_AS_NODE=1 electron scripts/update-electron-vendors.mjs",
"format": "npx prettier --write \"**/*.{js,mjs,cjs,ts,mts,cts,svelte,json}\""
},
"devDependencies": {
"@playwright/test": "^1.31.1",
"@ptkdev/sveltekit-electron-adapter": "^0.3.0",
"@sveltejs/adapter-static": "^2.0.1",
"@sveltejs/kit": "^1.5.0",
"@types/node": "18.14.1",
"@typescript-eslint/eslint-plugin": "5.53.0",
"@typescript-eslint/parser": "^5.45.0",
"autoprefixer": "^10.4.15",
"cross-env": "7.0.3",
"daisyui": "^3.5.1",
"electron": "23.1.1",
"electron-builder": "23.6.0",
"eslint": "8.35.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-svelte3": "^4.0.0",
"happy-dom": "8.9.0",
"nano-staged": "0.8.0",
"playwright": "1.31.1",
"postcss": "^8.4.28",
"prettier": "^2.8.0",
"prettier-plugin-svelte": "^2.8.1",
"simple-git-hooks": "2.8.1",
"svelte": "^3.54.0",
"svelte-bricks": "^0.2.0",
"svelte-check": "^3.0.1",
"tailwindcss": "^3.3.3",
"tslib": "^2.4.1",
"typescript": "4.9.5",
"unplugin-auto-expose": "0.0.4",
"vite": "4.1.4",
"vitest": "0.29.1"
},
"dependencies": {
"electron-updater": "5.3.0",
"viewerjs": "^1.11.5"
}
} this is my package.json, "type": "module", |
Not a JS packaging expert but maybe the need for |
@janosh I have the same issue, setting the "main" key did not work. I'm not using electron, just started up a basic Sveltekit app and installed this package. Note: I am using Svelte with Typescript |
@timmyrosen Just to confirm, you only had type resolution issues, no runtime import error, correct? The type resolution should be fixed in v0.2.1. Can you give it a try? |
@janosh Yep, works fine now, thanks! |
I installed this module using pnpm, and I've also installed the Svelte for VS Code plugin. However, following the official instructions to import had no effect (I encountered the error shown in the screenshot.). After trying to add the following line to the package's package.json:
I found that doing this made it work properly.
The text was updated successfully, but these errors were encountered: