question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

If there are two <script>tag, only the first one will be parsed.

See original GitHub issue

question

In some cases, a file may have two <script> tags, bug only the first one will be parsed.

exp:

<template>
  <div />
</template>

<script type="customBlock">
// The code here will be normally parsed
let a = 1
</script>

<script>
export default {
  //  The code here will be ignored
   let b = 2
}
</script>

image

Expect

Parse all code, or we can customize parsing of certain code libraries.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
uyarncommented, Mar 23, 2022

I got an error when I added <script> after <script setup> but the error got disappeared when I changed the order and put <script> above.

exactly, but it’s a conflict with the rule import/first >.<

1reaction
ota-meshicommented, Feb 17, 2022

Yes. Using <script> with <script setup> is already supported.

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - multiple versus single script tags
Builds up a string of the the text in the tag up until the first time it sees the string "</script>"; Hands that...
Read more >
Everything I Know About The Script Tag - Eager Blog
A script tag can either include the JavaScript directly, or it can point to a URL where the script should be loaded from....
Read more >
The Script Tag in Your HTML Document | by Bern
If you have multiple <script> tags in your HTML, this also means that both scripts will be downloaded and executed simultaneously.
Read more >
1. Loading and Execution - High Performance JavaScript ...
The JavaScript file will begin downloading at the point that the <script> tag is parsed, but the code will not be executed until...
Read more >
The Script element - HTML: HyperText Markup Language
For classic scripts, if the async attribute is present, then the classic script will be fetched in parallel to parsing and evaluated as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found