I try to load a module using fetch:
const response = await fetch('https://raw.githubusercontent.com/neondatabase/serverless/main/dist/npm/index.mjs');
const source = await response.text();
const module = await import('data:text/javascript,' + source);
But I get the error:
Uncaught SyntaxError: malformed Unicode character escape sequence
I think the problem is that the source contains a regular expression, which contains the escape code “s”.
How to quote this correctly for import
?