Skip to content

Commit 1ca63f8

Browse files
JerryWu1234wuls
andauthored
When csr is true, it causes a crash because resolve cannot be null as… (#7420)
* When csr is true, it causes a crash because resolve cannot be null as the second parameter * Create cyan-deers-glow.md --------- Co-authored-by: wuls <[email protected]>
1 parent c5626c8 commit 1ca63f8

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

.changeset/cyan-deers-glow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@builder.io/qwik': patch
3+
---
4+
5+
FIX: When csr is true, it causes a crash because resolve cannot be null as the second parameter

packages/qwik/src/optimizer/src/plugins/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function createPlugin(optimizerOptions: OptimizerOptions = {}) {
102102
rootDir: null as any,
103103
tsconfigFileNames: ['./tsconfig.json'],
104104
input: null as any,
105-
outDir: null as any,
105+
outDir: '',
106106
assetsDir: null as any,
107107
resolveQwikBuild: true,
108108
entryStrategy: null as any,

packages/qwik/src/optimizer/src/plugins/plugin.unit.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ test('debug true', async () => {
9090
assert.deepEqual(opts.debug, true);
9191
});
9292

93+
test('csr', async () => {
94+
const plugin = await mockPlugin();
95+
const opts = plugin.normalizeOptions({ csr: true });
96+
assert.deepEqual(opts.outDir, '');
97+
});
98+
9399
test('override entryStrategy', async () => {
94100
const plugin = await mockPlugin();
95101
const opts = plugin.normalizeOptions({

0 commit comments

Comments
 (0)