You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using NextJS and am calling the enableStaticRendering() function on the server. I currently have to import the function as follows:
import{enableStaticRendering}from'mobx-react';
Due to the way NextJS deals with imports while building their production mode, I am getting the following warnings:
./node_modules/scheduler/cjs/scheduler.production.min.js
A Node.js API is used (setImmediate at line: 11) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime
Import trace for requested module:
./node_modules/scheduler/cjs/scheduler.production.min.js
./node_modules/scheduler/index.js
./node_modules/react-dom/cjs/react-dom.production.min.js
./node_modules/react-dom/index.js
./node_modules/mobx-react-lite/es/utils/reactBatchedUpdates.js
./node_modules/mobx-react-lite/es/index.js
./node_modules/mobx-react/dist/mobxreact.esm.js
./node_modules/@freenome/nextjs/esm/containers/ClientPageContainer/index.js
./node_modules/@freenome/nextjs/esm/index.js
./node_modules/scheduler/cjs/scheduler.production.min.js
A Node.js API is used (setImmediate at line: 11) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime
Import trace for requested module:
./node_modules/scheduler/cjs/scheduler.production.min.js
./node_modules/scheduler/index.js
./node_modules/react-dom/cjs/react-dom.production.min.js
./node_modules/react-dom/index.js
./node_modules/mobx-react-lite/es/utils/reactBatchedUpdates.js
./node_modules/mobx-react-lite/es/index.js
./node_modules/mobx-react/dist/mobxreact.esm.js
./node_modules/@freenome/nextjs/esm/containers/ClientPageContainer/index.js
./node_modules/@freenome/nextjs/esm/index.js
Actual outcome:
When I do try to import directly from the source file to avoid the error like in this screenshot, I get typescript issues:
How to reproduce the issue:
I'm imagining, since there are so few static rendering functions in mobx-react-lite that if one were to update the package.json to add the exports section to provide a named export for the static rendering functions in then I could do what I needed. I am fairly confident that this change can be easily done in a backwards-compatible manner meaning that I could also import enableStaticRendering from the mob-react-lite as before.
Given that, I really can't provide an easily reproducible case for you unless you want me to link an entire nextjs application that is importing and using this function.
Versions
"mobx": "6.13.6",
"mobx-react": "9.2.0",
The text was updated successfully, but these errors were encountered:
I am using NextJS and am calling the
enableStaticRendering()
function on the server. I currently have to import the function as follows:Due to the way NextJS deals with imports while building their production mode, I am getting the following warnings:
Actual outcome:
When I do try to import directly from the source file to avoid the error like in this screenshot, I get typescript issues:
How to reproduce the issue:
I'm imagining, since there are so few static rendering functions in
mobx-react-lite
that if one were to update thepackage.json
to add the exports section to provide a named export for the static rendering functions in then I could do what I needed. I am fairly confident that this change can be easily done in a backwards-compatible manner meaning that I could also importenableStaticRendering
from themob-react-lite
as before.Given that, I really can't provide an easily reproducible case for you unless you want me to link an entire nextjs application that is importing and using this function.
Versions
"mobx": "6.13.6",
"mobx-react": "9.2.0",
The text was updated successfully, but these errors were encountered: