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

debug ssr server #6

Closed
ttrBetter opened this issue Jul 5, 2022 · 4 comments
Closed

debug ssr server #6

ttrBetter opened this issue Jul 5, 2022 · 4 comments

Comments

@ttrBetter
Copy link

We have converted our react build setup to use vavite, and we like the speed ;)
How do we debug backend (server) if we run the vite command we cannot set breakpoints in the server code.

@cyco130
Copy link
Owner

cyco130 commented Jul 5, 2022

Unfortunately it's an upstream issue with Vite: Vite's SSR transform don't support sourcemaps. There was an effort to make it work but it's not clear whether it's going forward. The way forward is more or less clear but someone needs to do the hard work.

Inserting debugger statements does work in the meantime.

@kemptone
Copy link

First off, love this project, thank you.
I am basing a project off of one of the examples:
https://github.com/cyco130/vavite/tree/main/examples/ssr-react-express
I am having perhaps a noob issue when I import something like "@reduxjs/toolkit". It works great local, but when I yarn build, and then yarn start I get an error like this.

`import { configureStore } from "@reduxjs/toolkit";
^^^^^^^^^^^^^^
SyntaxError: Named export 'configureStore' not found. The requested module '@reduxjs/toolkit' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@reduxjs/toolkit';
const { configureStore } = pkg;`

I've spent most of the day on it, trying different things. Wondering if there is an easy answer?

@cyco130
Copy link
Owner

cyco130 commented Sep 22, 2022

@kemptone this is an unrelated issue that doesn't belong here. But it comes up quite often so I opened an issue with some background and possible ways to fix it. Hope it helps.

@cyco130 cyco130 mentioned this issue Dec 20, 2022
@cyco130
Copy link
Owner

cyco130 commented Feb 27, 2023

Fixed in #17.

@cyco130 cyco130 closed this as completed Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants