Skip to content

Commit 92ef2f8

Browse files
committed
fix: set type module for qwik loader
1 parent abbd95a commit 92ef2f8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

packages/qwik/src/core/tests/render-api.spec.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,15 +699,19 @@ describe('render api', () => {
699699
containerTagName: 'div',
700700
debug: true,
701701
});
702-
expect(cleanupAttrs(result.html)).toContain('<script id="qwikloader" async>debug</script>');
702+
expect(cleanupAttrs(result.html)).toContain(
703+
'<script id="qwikloader" async type="module">debug</script>'
704+
);
703705
});
704706

705707
it('should emit qwik loader without debug mode', async () => {
706708
const result = await renderToStringAndSetPlatform(<Counter />, {
707709
containerTagName: 'div',
708710
debug: false,
709711
});
710-
expect(cleanupAttrs(result.html)).toContain('<script id="qwikloader" async>min</script>');
712+
expect(cleanupAttrs(result.html)).toContain(
713+
'<script id="qwikloader" async type="module">min</script>'
714+
);
711715
});
712716
});
713717
describe('snapshotResult', () => {

packages/qwik/src/server/ssr-container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ class SSRContainer extends _SharedContainer implements ISSRContainer {
835835
debug: this.renderOptions.debug,
836836
});
837837
// async allows executing while the DOM is being handled
838-
const scriptAttrs = ['id', 'qwikloader', 'async', true];
838+
const scriptAttrs = ['id', 'qwikloader', 'async', true, 'type', 'module'];
839839
const nonce = this.renderOptions.serverData?.nonce;
840840
if (nonce) {
841841
scriptAttrs.push('nonce', nonce);

0 commit comments

Comments
 (0)