You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having issues when using use server to enforce modules to be server only.
By following the steps below, you should encounter the following error:
16:51:23 [vite] Error when evaluating SSR module /src/routes/admin/organisations/(list).tsx?pick=route: failed to import "/src/database/organisations.ts"
|- Error: undefined does not match field "params": [Pattern] of type FunctionExpression
at addParam (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:455:27)
at eval (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:505:25)
at builder.from (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:503:46)
at wrapExports (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugins/wrap-exports.js:376:59)
at Object.transform (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugins/wrap-exports.js:41:28)
at TransformContext.transform (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugin.js:49:34)
at Object.transform (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44404:62)
at async loadAndTransform (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55078:29)
16:51:23 [vite] Error when evaluating SSR module /node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vinxi/lib/routes.js: failed to import "/src/routes/admin/organisations/(list).tsx?pick=route"
|- Error: undefined does not match field "params": [Pattern] of type FunctionExpression
at addParam (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:455:27)
at eval (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:505:25)
at builder.from (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:503:46)
at wrapExports (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugins/wrap-exports.js:376:59)
at Object.transform (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugins/wrap-exports.js:41:28)
at TransformContext.transform (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugin.js:49:34)
at Object.transform (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44404:62)
at async loadAndTransform (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55078:29)
16:51:23 [vite] Error when evaluating SSR module /node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@solidjs/start/shared/routes.ts: failed to import "/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vinxi/lib/routes.js"
|- Error: undefined does not match field "params": [Pattern] of type FunctionExpression
at addParam (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:455:27)
at eval (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:505:25)
at builder.from (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:503:46)
at wrapExports (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugins/wrap-exports.js:376:59)
at Object.transform (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugins/wrap-exports.js:41:28)
at TransformContext.transform (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugin.js:49:34)
at Object.transform (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44404:62)
at async loadAndTransform (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55078:29)
16:51:23 [vite] Error when evaluating SSR module /node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@solidjs/start/server/handler.tsx: failed to import "/node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@solidjs/start/shared/routes.ts"
|- Error: undefined does not match field "params": [Pattern] of type FunctionExpression
at addParam (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:455:27)
at eval (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:505:25)
at builder.from (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:503:46)
at wrapExports (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugins/wrap-exports.js:376:59)
at Object.transform (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugins/wrap-exports.js:41:28)
at TransformContext.transform (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugin.js:49:34)
at Object.transform (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44404:62)
at async loadAndTransform (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55078:29)
16:51:23 [vite] Error when evaluating SSR module /node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@solidjs/start/server/index.tsx: failed to import "/node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@solidjs/start/server/handler.tsx"
|- Error: undefined does not match field "params": [Pattern] of type FunctionExpression
at addParam (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:455:27)
at eval (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:505:25)
at builder.from (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:503:46)
at wrapExports (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugins/wrap-exports.js:376:59)
at Object.transform (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugins/wrap-exports.js:41:28)
at TransformContext.transform (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugin.js:49:34)
at Object.transform (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44404:62)
at async loadAndTransform (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55078:29)
16:51:23 [vite] Error when evaluating SSR module /src/entry-server.tsx: failed to import "/node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@solidjs/start/server/index.tsx"
|- Error: undefined does not match field "params": [Pattern] of type FunctionExpression
at addParam (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:455:27)
at eval (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:505:25)
at builder.from (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:503:46)
at wrapExports (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugins/wrap-exports.js:376:59)
at Object.transform (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugins/wrap-exports.js:41:28)
at TransformContext.transform (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugin.js:49:34)
at Object.transform (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44404:62)
at async loadAndTransform (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55078:29)
16:51:23 [vite] Error when evaluating SSR module #vinxi/handler/ssr: failed to import "/src/entry-server.tsx"
|- Error: undefined does not match field "params": [Pattern] of type FunctionExpression
at addParam (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:455:27)
at eval (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:505:25)
at builder.from (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:503:46)
at wrapExports (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugins/wrap-exports.js:376:59)
at Object.transform (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugins/wrap-exports.js:41:28)
at TransformContext.transform (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugin.js:49:34)
at Object.transform (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44404:62)
at async loadAndTransform (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55078:29)
[h3] [unhandled] H3Error: undefined does not match field "params": [Pattern] of type FunctionExpression
at addParam (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:455:27)
... 6 lines matching cause stack trace ...
at async loadAndTransform (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55078:29) {
cause: Error: undefined does not match field "params": [Pattern] of type FunctionExpression
at addParam (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:455:27)
at eval (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:505:25)
at builder.from (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:503:46)
at wrapExports (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugins/wrap-exports.js:376:59)
at Object.transform (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugins/wrap-exports.js:41:28)
at TransformContext.transform (/home/projects/solid-start-error/node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugin.js:49:34)
at Object.transform (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44404:62)
at async loadAndTransform (/home/projects/solid-start-error/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55078:29) {
plugin: 'vite-server-references',
id: '/home/projects/solid-start-error/src/database/organisations.ts',
pluginCode: '// uncomment me to see the error\n' +
' "use server";\n' +
'\n' +
'import { sql, type InferSelectModel } from "drizzle-orm";\n' +
'import { mysqlTable, timestamp, varchar } from "drizzle-orm/mysql-core";\n' +
...
'// }\n'
},
statusCode: 500,
fatal: false,
unhandled: true,
statusMessage: undefined,
data: undefined
}
The pnpm build step is less verbose:
[vite-server-references] undefined does not match field "params": [Pattern] of type FunctionExpression
file: /home/projects/solid-start-error/src/database/organisations.ts
ERROR undefined does not match field "params": [Pattern] of type FunctionExpression 17:00:32
at addParam (node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:455:27)
at eval (node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:505:25)
at builder.from (node_modules/.pnpm/[email protected]/node_modules/ast-types/lib/types.js:503:46)
at wrapExports (node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugins/wrap-exports.js:376:59)
at Object.transform (node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugins/wrap-exports.js:41:28)
at Object.transform (node_modules/.pnpm/@[email protected][email protected]/node_modules/@vinxi/plugin-directives/plugin.js:49:34)
at Object.handler (node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:48396:19)
at eval (node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:25569:40)
ERROR undefined does not match field "params": [Pattern] of type FunctionExpression 17:00:32
ELIFECYCLE Command failed with exit code 1.
Yeah this looks like a babel error. A compiler error on the Vinxi side around server functions. Looks like it is related to exporting the type definition. It must not be handling that properly. When I comment out the export type it works.
Duplicates
Latest version
Current behavior 😯
I'm having issues when using
use server
to enforce modules to be server only.By following the steps below, you should encounter the following error:
The
pnpm build
step is less verbose:Expected behavior 🤔
No response
Steps to reproduce 🕹
Steps:
use server
at the top of the file./src/database/organisations
Context 🔦
No response
Your environment 🌎
No response
The text was updated successfully, but these errors were encountered: