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

After build, dev server run in error process is not defined #161

Closed
beetaa opened this issue May 16, 2020 · 6 comments
Closed

After build, dev server run in error process is not defined #161

beetaa opened this issue May 16, 2020 · 6 comments

Comments

@beetaa
Copy link

beetaa commented May 16, 2020

Do NOT ignore this template or your issue will have a very high chance to be closed without comment.

Describe the bug

After a sucessful build of the app, when try running npm run dev again, it runs normally, but the app under the dev server cannot open in browser properly. the chrome console shows:

image

when trace into the file, it shows:

image

in the source code tab, the content of the (index) is:

image

line 12-17 is automatically commented.

when running vite with --debug --force flags, it shows:

image

Reproduction

Please provide a link to a repo that can reproduce the problem you ran into.

A reproduction is required unless you are absolutely sure that the the problem is obvious and the information you provided is enough for us to understand what the problem is. If a report has only vague description (e.g. just a generic error message) and has no reproduction, it will be closed immediately.

System Info

  • required vite version: 0.15.3
  • required Operating System: WSL2 in win10
  • required Node version: 13.9.0
  • Optional:
    • npm version: 6.13.7
    • Installed vue version: 3.0.0-beta.10
    • Installed @vue/compiler-sfc version: 3.0.0-beta.10

Logs (Optional if provided reproduction)

  1. Run vite or vite build with the --debug flag.
  2. Provide the error log here.
@underfin
Copy link
Member

underfin commented May 16, 2020

The reason for this. The reg matched comment script.
And other peopel simiar issues is also the script don't matched .
And other sence isn't rewrite other html files. eg.vuejs/core#1194 it isn't best practice for a spa appliction.Maybe we can add multi entry support it, like webpack entry.
const scriptRE = /(<script\b[^>]*>)([\s\S]*?)<\/script>/gm

I fix this through other way which devFlag + html.

But still has other bugs with the track dependencies.
1.Because maybe matched comment script.
2.Because matched one script tag and tracked one dependencies.

BTW, I find someone of the dependencies of vue is esm-bundler and the vue-next not packaged esm-browser. I'm confused with this, hope get some tips.

@underfin
Copy link
Member

#160

@yyx990803
Copy link
Member

I don't know if this is related to #160... or #164. The dev server should have nothing to do with the build. And I have no idea why the scripts are commented out unless there is a reproduction.

@yyx990803
Copy link
Member

@underfin now I understand what you mean. I didn't merge #164 because this and #160 are in fact separate problems, and multi-entry support is also more complex since it involves build.

@underfin
Copy link
Member

Yeah.I'm sorry for not say it clearly.

@vsly-ru
Copy link

vsly-ru commented May 9, 2021

I ran into the same problem with svelteKit, on just one specific page.
Can't develop my project without building it hundreds time a day, feels like a stone age.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants