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

Inconsistent behaviour between dev server and build after html comment #5040

Closed
JCHHeilmann opened this issue Jun 19, 2020 · 2 comments · Fixed by #5059
Closed

Inconsistent behaviour between dev server and build after html comment #5040

JCHHeilmann opened this issue Jun 19, 2020 · 2 comments · Fixed by #5059
Labels

Comments

@JCHHeilmann
Copy link

JCHHeilmann commented Jun 19, 2020

Describe the bug
The below code snippet results in two different results depending on if you use npm run dev or do a build with npm run build and then for example npm run start.

With the dev server everything is fine. When using the result of the build "Style: " is missing.

The code snippet:

<span>
      Style:
      <!-- prettier-ignore -->
      <a href="https://getbootstrap.com/" target="_blank">Bootstrap</a>.
</span>

The comment is needed because of an issue with prettier in the svelte vs code extension by the way. It formats the "." on the next line, which results in an unwanted whitespace after the link.

Logs
No warnings or errors during build.

To Reproduce
It works in the REPL just like when using the dev server: https://svelte.dev/repl/d1a66a13c89945ea8e0c7376821b872b?version=3.23.2

Expected behavior
I would expect both builds to be consistent. Apart from that I guess I would the comment to not have an effect? But I'm not sure, if I'm using the comment incorrectly.

Information about your Svelte project:

  • Your browser and the version: Chrome 83.0.4103.97

  • Your operating system: OS X 10.15.5

  • Svelte version: 3.23.2

  • Using Rollup

Severity
This issue resulted in a deployment with text missing because everything seemed to work fine with the dev server. I guess I could (should?) double check everything in the build, but really the behaviour between the two needs to be consistent.

Thank you.

@Conduitry Conduitry added the bug label Jun 19, 2020
@Conduitry
Copy link
Member

Yep this looks like a bug in how we're generating the optimized prod mode elm.innerHTML = 'whatever' code for places that have static markup.

@Conduitry
Copy link
Member

The prod mode output in this case should be fixed in 3.24.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants