-
Notifications
You must be signed in to change notification settings - Fork 93
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
[Issue] Plugin is not working #44
Comments
Yeah this one is tricky. Vinxi does the server and static assets slightly differently from vite. We have this concept of routers and each public directory is just another router. So the default solid-start app config is approximately this: import { serverFunctions } from "@vinxi/server-functions/plugin";
import { createApp } from "vinxi";
import solid from "vite-plugin-solid";
export function defineConfig(options) {
return createApp({
routers: [
{
name: "public",
mode: "static",
dir: "./public",
base: "/",
},
{
name: "client",
mode: "build",
handler: "./app/client.tsx",
target: "browser",
plugins: () => [serverFunctions.client(), solid({ ssr: true })],
base: "/_build",
},
{
name: "ssr",
mode: "handler",
handler: "./app/server.tsx",
target: "server",
plugins: () => [solid({ ssr: true })],
},
serverFunctions.router(),
],
});
} What you can do to add another router to the mix is: import { defineConfig } from '@solidjs/start/config'
const config = defineConfig({ ... })
config.addRouter({
mode: "static",
name: "solid-start-cmp",
dir: "node_modules/solid-start-cmp/public",
base: "/",
});
export default config; |
Now I have this error :
|
@nksaraf is it possible to reopen it ? |
Ohh this was a dumb mistake where I didn't include |
demo-ventes git:(solid-migration) ✗ pnpm build
> demo-ventes@ build /home/quentin/Documents/dev/madeformed/demo-ventes
> vinxi build
vinxi 0.0.59
The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
┌────────────────────────────┐
│ ⚙ Building your app... │
└────────────────────────────┘
┌──────────────────────────────────┐
│ 📦 Compiling client router... │
└──────────────────────────────────┘
vinxi building router client in build mode
[ '#vinxi/handler/client' ]
vite v4.5.0 building for production...
✓ 6 modules transformed.
✓ built in 127ms
[vite]: Rollup failed to resolve import "#start/app" from "/home/quentin/Documents/dev/madeformed/demo-ventes/node_modules/.pnpm/@solidjs+start@0.4.2_rollup@3.29.4_solid-js@1.8.7_vinxi@0.0.59_vite@5.0.10/node_modules/@solidjs/start/client/StartClient.tsx".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
[11:38:07 AM] ERROR [vite]: Rollup failed to resolve import "#start/app" from "/home/quentin/Documents/dev/madeformed/demo-ventes/node_modules/.pnpm/@solidjs+start@0.4.2_rollup@3.29.4_solid-js@1.8.7_vinxi@0.0.59_vite@5.0.10/node_modules/@solidjs/start/client/StartClient.tsx".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external
at viteWarn (node_modules/.pnpm/vite@4.5.0_@types+node@18.18.8_sass@1.69.5_terser@5.24.0/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:48216:27)
at onRollupWarning (node_modules/.pnpm/vite@4.5.0_@types+node@18.18.8_sass@1.69.5_terser@5.24.0/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:48248:9)
at onwarn (node_modules/.pnpm/vite@4.5.0_@types+node@18.18.8_sass@1.69.5_terser@5.24.0/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:47976:13)
at node_modules/.pnpm/rollup@3.29.4/node_modules/rollup/dist/es/shared/node-entry.js:24276:13
at Object.logger [as onLog] (node_modules/.pnpm/rollup@3.29.4/node_modules/rollup/dist/es/shared/node-entry.js:25950:9)
at ModuleLoader.handleInvalidResolvedId (node_modules/.pnpm/rollup@3.29.4/node_modules/rollup/dist/es/shared/node-entry.js:24862:26)
at node_modules/.pnpm/rollup@3.29.4/node_modules/rollup/dist/es/shared/node-entry.js:24822:26
[11:38:07 AM] ERROR [vite]: Rollup failed to resolve import "#start/app" from "/home/quentin/Documents/dev/madeformed/demo-ventes/node_modules/.pnpm/@solidjs+start@0.4.2_rollup@3.29.4_solid-js@1.8.7_vinxi@0.0.59_vite@5.0.10/node_modules/@solidjs/start/client/StartClient.tsx".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external
ELIFECYCLE Command failed with exit code 1.
```
@nksaraf |
I don't have such import |
Can I get a repro of this? I am not sure why this is happening? Could be a bug |
…atures fix (fixes [Issue] Plugin is not working #44)
feat: add process.env.MINIFY support for build, add preserveEntrySignatures fix (fixes [Issue] Plugin is not working #44)
nksaraf/test-cmp@5529e8f should have the latest commit with the fixes. I think there was some miscommunication with the first fix. solid-start's defineConfig is already creating the main thing for you. You had to add the |
Yes it working ! Thanks ! |
@nksaraf I have an issue with my vite plugin "unplugin-imagemin/vite" can you check please. It's the same repo but you need to rebase. > test-cmp@ build /home/quentin/Documents/dev/test/test-cmp
> vinxi build
vinxi 0.0.60
start {
appRoot: './src',
ssr: false,
islands: false,
server: { base: undefined },
solid: {}
}
vinxi Found vite.config.js with app config
┌────────────────────────────┐
│ ⚙ Building your app... │
└────────────────────────────┘
removing /home/quentin/Documents/dev/test/test-cmp/.vinxi/build/ssr
removing /home/quentin/Documents/dev/test/test-cmp/.vinxi/build/client
removing /home/quentin/Documents/dev/test/test-cmp/.vinxi/build/server-fns
┌───────────────────────────────┐
│ 📦 Compiling ssr router... │
└───────────────────────────────┘
vinxi building router ssr in handler mode
vite v4.5.0 building SSR bundle for production...
"createHandler" is imported from external module "h3" but never used in "node_modules/.pnpm/vinxi@0.0.60_rollup@3.29.4_terser@5.26.0/node_modules/vinxi/runtime/server.js".
✓ 40 modules transformed.
.vinxi/build/ssr/manifest.json 1.40 kB
.vinxi/build/ssr/assets/index-fb87c914.css 46.63 kB
.vinxi/build/ssr/_...404_.js 0.74 kB
.vinxi/build/ssr/about.js 0.96 kB
.vinxi/build/ssr/assets/components-86ea9901.js 1.20 kB
.vinxi/build/ssr/index.js 3.61 kB
.vinxi/build/ssr/ssr.js 6.50 kB
[unplugin-imagemin] 📦 📦 Process start with Mode sharp
✓ built in 743ms
✔ build done 7:01:06 AM
┌──────────────────────────────────┐
│ 📦 Compiling client router... │
└──────────────────────────────────┘
vinxi building router client in build mode
[
'#vinxi/handler/client',
'/home/quentin/Documents/dev/test/test-cmp/src/routes/[...404].tsx?pick=default&pick=$css',
'/home/quentin/Documents/dev/test/test-cmp/src/routes/about.tsx?pick=default&pick=$css',
'/home/quentin/Documents/dev/test/test-cmp/src/routes/index.tsx?pick=default&pick=$css'
]
plugin-legacy overrode 'build.target'. You should pass 'targets' as an option to this plugin with the list of legacy browsers to support instead.
vite v4.5.0 building for production...
virtual:#vinxi/handler/client (1:106) "default" is not exported by "src/entry-client.tsx", imported by "virtual:#vinxi/handler/client".
✓ 115 modules transformed.
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
[Error: ENOENT: no such file or directory, open '/home/quentin/Documents/dev/test/test-cmp/.vinxi/build/client/_build/assets/_...404_-legacy-ca63b2ec.js'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/home/quentin/Documents/dev/test/test-cmp/.vinxi/build/client/_build/assets/_...404_-legacy-ca63b2ec.js'
}
Node.js v18.17.1
ELIFECYCLE Command failed with exit code 1.``` |
@nksaraf any update ? |
Hi,
I'm using vinxi with solid start template and currently this plugin is not working : https://github.com/nguyenbatranvan/vite-multiple-assets
If needed I can create a repro.
Regards
The text was updated successfully, but these errors were encountered: