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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development server inexplicably strips type="module" from <script> tag #9716

Open
gcleaves opened this issue May 15, 2024 · 1 comment
Open

Comments

@gcleaves
Copy link

gcleaves commented May 15, 2024

馃悰 bug report

Development server inexplicably strips type="module" from <script> tag, breaking the page. The normal build process does not do that.

馃帥 Configuration (.babelrc, package.json, cli command)

No config.

Input HTML:

<html lang="en">
  <head>
    <meta charset="utf-8"/>
    <title>My First Parcel App</title>
    <script src="https://unpkg.com/petite-vue" defer init></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.15.0/cdn/themes/light.css" />
    <script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.15.0/cdn/shoelace-autoloader.js"></script>

    <style>
        #graph {
          border: 1px solid #e0e0e0;
          width: 100%;
          height: 99%;
        }
      </style>
  </head>
  <body>
    <div v-scope="{ count: 0 }">
      {{ count }}
      <sl-button @click="count++">inc</sl-button>
    </div>
    <div id="graph"></div>
    <sl-drawer label="Drawer" class="drawer-overview">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit.
      <sl-button slot="footer" variant="primary">Close</sl-button>
    </sl-drawer>
    
  </body>
</html>

馃 Expected Behavior

Don't remove type=module

馃槸 Current Behavior

type=module is removed from the script tag in development server build only.

馃拋 Possible Solution

馃敠 Context

Can't leverage dev server

馃捇 Code Sample

npx parcel --no-cache app/index.html

馃實 Your Environment

Mac OS

Software Version(s)
Parcel 2.12.0
Node v21.7.2
npm/Yarn npm
Operating System Mac OS
@gcleaves
Copy link
Author

Further to this, parcel watch behaves the same way, breaking the app, while parcel build works correctly.

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

1 participant