-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Import error on startup when a Fresh project is a workspace member #24622
Comments
This seems to occur when a dependency of a workspace member refers to something in the import map of said member. In this case fresh is expected to resolve the |
is this the same issue as when a
seems to work for not island components |
I have the same issue with preact. Trying to make a fresh app a workspace member (it’s been a subfolder) |
issue still happening |
yes issue still happens. |
+1
|
having exact same issue when using workspace and deno. ward. |
I got it to work by adding the dependencies of the fresh app into my root deno.jsonc // root deno config
{
"workspace": [
"./projects/fresh-app"
],
"tasks": {
"dev:fresh-app": "cd projects/fresh-app && deno run -A --node-modules-dir start"
},
"nodeModulesDir": "auto",
"imports": {
"$fresh/": "https://deno.land/x/[email protected]/",
"preact": "https://esm.sh/[email protected]",
"preact/": "https://esm.sh/[email protected]/",
"@preact/signals": "https://esm.sh/*@preact/[email protected]",
"@preact/signals-core": "https://esm.sh/*@preact/[email protected]",
"$std/": "https://deno.land/[email protected]/"
},
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "preact",
"lib": [
"deno.window",
"dom"
],
"strict": true
}
} // project deno config
{
"tasks": {
"check": "deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx",
"cli": "echo \"import '\\$fresh/src/dev/cli.ts'\" | deno run --unstable -A -",
"manifest": "deno task cli manifest $(pwd)",
"start": "deno run -A --watch=static/,routes/ dev.ts",
"build": "deno run -A dev.ts build",
"preview": "deno run -A main.ts",
"update": "deno run -A -r https://fresh.deno.dev/update ."
},
"lint": {
"rules": {
"tags": [
"fresh",
"recommended"
]
}
},
"exclude": [
"**/_fresh/*"
],
"fmt": {
"lineWidth": 120,
"singleQuote": true
},
"imports": {
}
}
-> deno task dev:fresh-app If you get // deno-lint-ignore no-unused-vars
import * as React from "preact/compat"; found here -> denoland/fresh#785 (comment) |
If a Fresh project is a workspace member, an import error occurs on startup. Here's how to reproduce it:
Here's the error message:
The text was updated successfully, but these errors were encountered: