Skip to content

Commit 097dfce

Browse files
committed
Fix dynamic dependencies with # folder names
Fixes codesandbox#787
1 parent ea96263 commit 097dfce

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

packages/app/src/sandbox/eval/npm/fetch-npm-module.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,14 @@ function downloadDependency(depName: string, depVersion: string, path: string) {
101101
return packages[path];
102102
}
103103

104-
const relativePath = path.replace(
105-
new RegExp(
106-
`.*${pathUtils.join('/node_modules', depName)}`.replace('/', '\\/')
107-
),
108-
''
109-
);
110-
104+
const relativePath = path
105+
.replace(
106+
new RegExp(
107+
`.*${pathUtils.join('/node_modules', depName)}`.replace('/', '\\/')
108+
),
109+
''
110+
)
111+
.replace(/#/g, '%23');
111112
const isGitHub = /\//.test(depVersion);
112113

113114
const url = isGitHub

0 commit comments

Comments
 (0)