File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,11 @@ export const Playground = ({
151151 try {
152152 loadCSS ( isDarkMode ? CDN_URLS . prismCSSDark : CDN_URLS . prismCSSLight , "prism" ) ;
153153 // numpy-ts v1.3+ ships an ESM browser bundle — load via dynamic import.
154- const npModule = await import ( /* webpackIgnore: true */ /* @vite -ignore */ CDN_URLS . numpyTs ) ;
154+ // Wrapped in `new Function` so Mintlify's MDX compiler doesn't
155+ // misparse the bare `import(...)` token as a static import statement
156+ // (which isn't allowed inside a generated function body).
157+ const dynamicImport = new Function ( "url" , "return import(url)" ) ;
158+ const npModule = await dynamicImport ( CDN_URLS . numpyTs ) ;
155159 npRef . current = npModule . default ?? npModule ;
156160 await loadScript ( CDN_URLS . prismCore ) ;
157161 await loadScript ( CDN_URLS . prismTS ) ;
You can’t perform that action at this time.
0 commit comments