Closed karlhorky closed 3 weeks ago
Addresses https://github.com/cookpete/react-player/issues/1613#issuecomment-2067993523
Comment content copied here:
Ah, seems like this 'react-player/file' import fails with a Default condition should be last one error message on compile time (Next.js) though 😬
'react-player/file'
Default condition should be last one
Module not found: Default condition should be last one 5 | // eslint-disable-next-line import/no-unresolved -- eslint-plugin-import doesn't understand `exports` in package.json yet https://github.com/import-js/eslint-plugin-import/issues/1810 > 6 | import ReactPlayer from 'react-player/file'; | ^ 7 | 8 | // ``` 9 | https://nextjs.org/docs/messages/module-not-found
So maybe the "exports" config in package.json is misconfigured...
"exports"
package.json
Eg. an example PR fixing such an error:
Glad to help, thanks for the review and merge!
I see that this was published in react-player@3.0.0-canary.4, thanks!
react-player@3.0.0-canary.4
I can confirm that this is working for our Next.js project 👍
Addresses https://github.com/cookpete/react-player/issues/1613#issuecomment-2067993523
Comment content copied here:
Ah, seems like this
'react-player/file'
import fails with aDefault condition should be last one
error message on compile time (Next.js) though 😬So maybe the
"exports"
config inpackage.json
is misconfigured...Eg. an example PR fixing such an error: