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

Script import inside the HTML body no longer works #20

Open
ImZaryab opened this issue Jan 3, 2023 · 0 comments
Open

Script import inside the HTML body no longer works #20

ImZaryab opened this issue Jan 3, 2023 · 0 comments

Comments

@ImZaryab
Copy link

ImZaryab commented Jan 3, 2023

In "layouts/Post.astro" at Line 16:

<script src="../components/CodeBlock/code-block.ts"></script>

The import inside the HTML body is not working any longer. It throws the following error:

[plugin:astro] Could not import /src/layouts/Post.astro?astro&type=script&index=0&lang.ts.
Error: failed to load module for ssr: /src/layouts/Post.astro?astro&type=script&index=0&lang.ts

If you add "type=module", it renders the page but it doesn't load the component.

I was able to get the code block component to work by importing it as a component and adding it like this:

<CodeBlockNew client:visible/>

but it renders 2 code-blocks in this manner.

code-blcok

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