Skip to content

Commit 9de8f40

Browse files
committed
stringify symbol
1 parent 0cd087c commit 9de8f40

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

packages/kit/src/exports/vite/build/build_server.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,19 @@ export function build_server_nodes(out, kit, manifest_data, server_manifest, cli
111111
dedent`
112112
export const universal = new Proxy(${s(Object.fromEntries(mod.static_exports))}, {
113113
async get(target, prop) {
114-
if (universal_dynamic_exports.has(prop)) {
114+
const key = String(prop);
115+
if (universal_dynamic_exports.has(key)) {
115116
try {
116-
return (universal_cache ??= await import('../${universal_file}'))[prop];
117+
return (universal_cache ??= await import('../${universal_file}'))[key];
117118
} catch (error) {
118-
console.error(\`${node.universal} was loaded because the value of the \\\`\${prop}\\\` export could not be statically analysed\`);
119+
console.error(\`${node.universal} was loaded because the value of the \\\`\${key}\\\` export could not be statically analysed\`);
119120
throw error;
120121
}
121122
}
122-
return target[prop];
123+
return target[key];
123124
},
124125
has(target, prop) {
125-
return prop in target || universal_dynamic_exports.has(prop);
126+
return prop in target || universal_dynamic_exports.has(String(prop));
126127
},
127128
ownKeys(target) {
128129
return [...Reflect.ownKeys(target), ...universal_dynamic_exports];

packages/kit/src/exports/vite/dev/index.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -215,31 +215,26 @@ export async function dev(vite, vite_config, svelte_config) {
215215

216216
if (mod) {
217217
result.universal = new Proxy(Object.fromEntries(mod.static_exports), {
218-
/**
219-
* @param {string} prop
220-
*/
221218
async get(target, prop) {
222-
if (mod.dynamic_exports.has(prop)) {
219+
const key = String(prop);
220+
if (mod.dynamic_exports.has(key)) {
223221
try {
224-
return (await load_universal_module())[prop];
222+
return (await load_universal_module())[key];
225223
} catch (error) {
226224
console.error(
227225
colors
228226
.bold()
229227
.red(
230-
`${node.universal} was loaded because the value of the \`${prop}\` export could not be statically analysed`
228+
`${node.universal} was loaded because the value of the \`${key}\` export could not be statically analysed`
231229
)
232230
);
233231
throw error;
234232
}
235233
}
236-
return target[prop];
234+
return target[key];
237235
},
238-
/**
239-
* @param {string} prop
240-
*/
241236
has(target, prop) {
242-
return prop in target || mod.dynamic_exports.has(prop);
237+
return prop in target || mod.dynamic_exports.has(String(prop));
243238
},
244239
ownKeys(target) {
245240
return [...Reflect.ownKeys(target), ...mod.dynamic_exports];

0 commit comments

Comments
 (0)