Skip to content
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

[Bug?]: Dev server crashes when there is a syntax error #1222

Closed
2 tasks done
doeixd opened this issue Jan 5, 2024 · 9 comments
Closed
2 tasks done

[Bug?]: Dev server crashes when there is a syntax error #1222

doeixd opened this issue Jan 5, 2024 · 9 comments
Labels
bug Something isn't working vinxi related to vinxi

Comments

@doeixd
Copy link
Contributor

doeixd commented Jan 5, 2024

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

I have auto save enabled on my editor, and when I'm editing the code, there will be a temporary state where there is a syntax error, during this time the solid start / vinxi dev server crashes, and has to be restarted. This slows down development.

Here is the error:

node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: Transform failed with 1 error:
<stdin>:15:41: ERROR: Expected ";" but found ")"
    at failureErrorWithLog (C:\Users\Pglenn\Desktop\convert\Final\interface\node_modules\esbuild\lib\main.js:1649:15)
    at C:\Users\Pglenn\Desktop\convert\Final\interface\node_modules\esbuild\lib\main.js:847:29
    at responseCallbacks.<computed> (C:\Users\Pglenn\Desktop\convert\Final\interface\node_modules\esbuild\lib\main.js:703:9)
    at handleIncomingPacket (C:\Users\Pglenn\Desktop\convert\Final\interface\node_modules\esbuild\lib\main.js:762:9)
    at Socket.readFromStdout (C:\Users\Pglenn\Desktop\convert\Final\interface\node_modules\esbuild\lib\main.js:679:7)
    at Socket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23) {
  errors: [
    {
      detail: undefined,
      id: '',
      location: {
        column: 41,
        file: '<stdin>',
        length: 1,
        line: 15,
        lineText: '  let result =  await db.brand.findMany())',
        namespace: '',
        suggestion: ';'
      },
      notes: [],
      pluginName: '',
      text: 'Expected ";" but found ")"'
    }
  ],
  warnings: []
}

Expected behavior 🤔

I would expect the dev server to print the error, then wait till the watcher sees a new version of the file, then use that updated file

Steps to reproduce 🕹

Steps:

  1. Create a syntax error

Context 🔦

No response

Your environment 🌎

Windows 11
@doeixd doeixd added the bug Something isn't working label Jan 5, 2024
@ryansolid ryansolid added the vinxi related to vinxi label Jan 5, 2024
@frenzzy
Copy link
Contributor

frenzzy commented Jan 5, 2024

+1, with the latest SolidStart version 0.4.3 example with-auth is not working anymore.

Screenshot 2024-01-05 at 20 21 35

By some reason import of @solidjs/start/server is compiled to null, for example:

import { useSession } from '@solidjs/start/server'

// TypeError: Cannot read properties of null (reading 'useSession')

@edivados
Copy link
Contributor

edivados commented Jan 6, 2024

@frenzzy

By some reason import of @solidjs/start/server is compiled to null, for example:

import { useSession } from '@solidjs/start/server'

// TypeError: Cannot read properties of null (reading 'useSession')

The problem is only in dev. Importing useSession from vinxi/server instead seems to work. No idea why.
It's a re-re-export from h3.

@nksaraf
Copy link
Member

nksaraf commented Jan 15, 2024

@frenzzy

By some reason import of @solidjs/start/server is compiled to null, for example:

import { useSession } from '@solidjs/start/server'

// TypeError: Cannot read properties of null (reading 'useSession')

The problem is only in dev. Importing useSession from vinxi/server instead seems to work. No idea why. It's a re-re-export from h3.

should be fixed in latest version of solid start

@ryansolid
Copy link
Member

ryansolid commented Jan 16, 2024

with-auth issue is fixed now.

That being said @nksaraf if I go in any file and cause a JS syntax error, like mess up the closing tag of a JSX element or missing a closing bracket on a function etc... the dev server immediately crashes.

@angry-meow
Copy link

@nksaraf:

should be fixed in latest version of solid start

FYI, in the latest version (0.4.11) it still crashes.

image

It happens even with the JSX errors, e.g. Invalid JSX: <tr> cannot be child of <table>.

@nksaraf
Copy link
Member

nksaraf commented Jan 31, 2024

That comment was abojt the useSession being null. The dev server crashing on syntax error is not fixed yet

@doeixd
Copy link
Contributor Author

doeixd commented Feb 27, 2024

I see this issue was closed on vinxi, but I am still experiencing this problem.

nksaraf/vinxi#100

@nksaraf

@nksaraf
Copy link
Member

nksaraf commented Feb 27, 2024

can i get a precise repro. i have been trying to ssquash this issue and see it rarely myself now

@doeixd
Copy link
Contributor Author

doeixd commented Feb 28, 2024

Looks like I'm wrong, the dev server indeed no longer crashes in the latest version. It prints a similar error, but doesn't crash.

image
codesandbox

My bad!

@doeixd doeixd closed this as completed Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vinxi related to vinxi
Projects
None yet
Development

No branches or pull requests

6 participants