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

Bug: <script> tags with relative path in src get the file contents placed in src on build #65

Open
svallory opened this issue Apr 15, 2024 · 0 comments

Comments

@svallory
Copy link

svallory commented Apr 15, 2024

What's happening

A script tag with a relativesrc path like <script src="./test.js"></script>

gets compiled into <script src="[CONTENTS OF test.js]"></script>

NOTE: That does not happen with absolute paths: /js/script.js or full URLs

Expected Behavior

Marko does nothing and the script tag remains "as is". I was caught totally by surprise that Marko/Run was doing anything at all with something I considered "plain html".

Ok, nothing in Marko is plain HTML... but usually boundaries and side effects are clear. In this case, I don't know what's going on here.

How to reproduce:

  1. Create a new Run project

  2. Create a src/routes/test.js file

    export default "the script content";
  3. Add <script src="./test.js"></script> to +layout.marko

    image
  4. Build

This is easier to see when using the static adapter...

image

But it happens with the default adapter too

image
@svallory svallory changed the title Bug: Scripts with relative path get content placed in src Bug:<script> tags with relative path in src get the file contents placed in src on build Apr 15, 2024
@svallory svallory changed the title Bug:<script> tags with relative path in src get the file contents placed in src on build Bug: <script> tags with relative path in src get the file contents placed in src on build Apr 15, 2024
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