Duplicates
Latest version
Current behavior 😯
When you build a SolidStart app using npm run build, you receive the following warning:
Error when using sourcemap for reporting an error: Can't resolve original location of error.
Module level directives cause errors when bundled, "use server" in "src/hi.ts" was ignored.
Expected behavior 🤔
Either the module-level "use server" should work as it did before SolidStart v1.1.0, or the documentation should be updated:
https://docs.solidjs.com/solid-start/reference/server/use-server#use-server
If "use server" is inserted as the first line in a file, the entire file will become server-only.
Steps to reproduce 🕹
Steps:
- Run
npm create solid with the default selections to create a new project.
- Create
src/hi.ts with the following content:
'use server'
export const hi = async () => {
console.log('hi!')
}
- Add the following to
src/app.tsx:
import { action } from "@solidjs/router";
import { hi } from "./hi";
const a = action(hi)
- Run
npm run build and observe the output:

Context 🔦
No response
Your environment 🌎
SolidStart v1.1.0
Vinxi v0.5.3
Duplicates
Latest version
Current behavior 😯
When you build a SolidStart app using
npm run build, you receive the following warning:Expected behavior 🤔
Either the module-level
"use server"should work as it did before SolidStartv1.1.0, or the documentation should be updated:https://docs.solidjs.com/solid-start/reference/server/use-server#use-server
Steps to reproduce 🕹
Steps:
npm create solidwith the default selections to create a new project.src/hi.tswith the following content:src/app.tsx:npm run buildand observe the output:Context 🔦
No response
Your environment 🌎