Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't import the named export 'AlwaysDepth' from non EcmaScript module (only default export is available) #312

Closed
abdulrehman1937 opened this issue Aug 30, 2021 · 6 comments
Labels
react Related to react or create-react-app regression Something that worked before is now broken

Comments

@abdulrehman1937
Copy link

abdulrehman1937 commented Aug 30, 2021

Description of the bug

Started getting this error after postprocessing v6.22.4 was released.

To Reproduce

I am using depth of field effect. I can not run my app. It does not compile.

Expected behaviour

App should compile and run smoothly like before.

Screenshots

Added

Library versions used

  • "@react-three/postprocessing": "^2.0.5",

Screenshot 2021-08-31 at 1 09 55 AM

Desktop

  • MacOs BigSur 11.5.2
    -Chrome 92.0.4515.159
@Craaftx
Copy link

Craaftx commented Aug 30, 2021

Same issue with
@react-three/postprocessing": "^2.0.5
postprocessing": "6.22.4

Desktop :
Windows 11 21H2
Firefox 91.0.2 (64 bits)

@vanruesc
Copy link
Member

Hi, thanks for the report!

What's your node.js version and which bundler are you using? I'd like to reproduce this issue locally.

It looks like postprocessing is being imported as a native ES6 module and transitive imports from three are treated the same way although three is not of type module.

@vanruesc vanruesc added the investigating A potential bug that requires further research label Aug 30, 2021
@abdulrehman1937
Copy link
Author

Node v v16.5.0
Bundler webpack (using creat-react-app)

@vanruesc
Copy link
Member

vanruesc commented Aug 30, 2021

Mh, I just found this: formatjs/formatjs#1395 & facebook/create-react-app#10356

Looks like CRA simply doesn't support .mjs imports which is a bummer. I changed the extension because it enables blazing fast Ava.js testing without esm.js when importing stuff from postprocessing like Pass in other projects.

I guess I'll change it back to .esm.js for now. I wonder how CRA would react to type: module in package.json.

@vanruesc vanruesc added regression Something that worked before is now broken react Related to react or create-react-app and removed investigating A potential bug that requires further research labels Aug 30, 2021
@vanruesc
Copy link
Member

Fixed in postprocessing@6.22.5.

vanruesc added a commit that referenced this issue Feb 2, 2022
@vanruesc
Copy link
Member

vanruesc commented Feb 7, 2022

@abdulrehman1937 I've changed the bundle name to postprocessing.mjs in postprocessing@6.24.0. This comment suggests that CRA 5.0.0 can now handle .mjs bundles. Let me know if there are any issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
react Related to react or create-react-app regression Something that worked before is now broken
Projects
None yet
Development

No branches or pull requests

3 participants