Skip to content

Commit

Permalink
fix: Change dynamic import to string (deephaven#1484)
Browse files Browse the repository at this point in the history
- Remove a warning when building with webpack:
https://stackoverflow.com/a/73359606
  • Loading branch information
mofojed authored Sep 8, 2023
1 parent d35aa49 commit 45e2ada
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/jsapi-bootstrap/src/ApiBootstrap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export function ApiBootstrap({
useEffect(() => {
async function loadApi() {
try {
const dh: DhType = (await import(/* @vite-ignore */ apiUrl)).default;
// Using a string template around `apiUrl` to avoid a warning with webpack: https://stackoverflow.com/a/73359606
const dh: DhType = (await import(/* @vite-ignore */ `${apiUrl}`))
.default;
log.info('API bootstrapped from', apiUrl);
setApi(dh);
if (setGlobally) {
Expand Down

0 comments on commit 45e2ada

Please sign in to comment.