fix(remix): Use import() to get react-router-dom in Express wrapper.#5810
fix(remix): Use import() to get react-router-dom in Express wrapper.#5810AbhiPrasad merged 1 commit intomasterfrom
react-router-dom in Express wrapper.#5810Conversation
| next: ExpressNextFunction, | ||
| ): Promise<void> { | ||
| if (!pkg) { | ||
| pkg = await import(`${cwd()}/node_modules/react-router-dom`); |
There was a problem hiding this comment.
Will is break if folks are bundling stuff (like in a serverless function)?
Can we just call import directly on react-router-dom?
There was a problem hiding this comment.
Will is break if folks are bundling stuff (like in a serverless function)?
I think it depends on the packager used, but it seems there are some workarounds if such thing happens: https://www.serverless.com/plugins/serverless-jetpack#handling-dynamic-import-misses. It also applies to loadModule (using module.require) as far as I understand.
Can we just call import directly on react-router-dom?
Tried that and it's working, but while building @sentry/remix I got a warning from Rollup because, it actually tried to resolve the deps from sentry-javascript/node_modules on build time.
Details copied from: #5796 which is reverted by #5802
Parameterized Route Transaction
Root Transaction
Redirected Route Transaction