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

Remix: Named import of ColorSchemeScript throws an error #4787

Closed
majidmadadi opened this issue Sep 19, 2023 · 5 comments
Closed

Remix: Named import of ColorSchemeScript throws an error #4787

majidmadadi opened this issue Sep 19, 2023 · 5 comments
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)

Comments

@majidmadadi
Copy link

majidmadadi commented Sep 19, 2023

What package has an issue

@mantine/core

Describe the bug

I followed the documentation to create a remix typescript app and I came across the following error:


import { ColorSchemeScript, MantineProvider } from "@mantine/core";
         ^^^^^^^^^^^^^^^^^
    SyntaxError: Named export 'ColorSchemeScript' not found. The requested module '@mantine/core' is a CommonJS module, which may 
    not support all module.exports as named exports.
    CommonJS modules can always be imported via the default export, for example using:
    
    import pkg from '@mantine/core';
    const { ColorSchemeScript, MantineProvider } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
    at ModuleJob.run (node:internal/modules/esm/module_job:190:5)

What version of @mantine/* page do you have in package.json? (Note that all @mantine/* packages must have the same version in order to work correctly)

7.0.0

If possible, please include a link to a codesandbox with the reproduced problem

No response

Do you know how to fix the issue

None

Are you willing to participate in fixing this issue and create a pull request with the fix

None

Possible fix

No response

@NikolaGrgic
Copy link

I'm experiencing the same issue using Mantine with Remix.

@rtivital rtivital changed the title Named import of ColorSchemeScript throws an error Remix: Named import of ColorSchemeScript throws an error Sep 21, 2023
@rtivital rtivital added the remix label Sep 21, 2023
@KubaJastrz
Copy link

It looks like @mantine/* packages are incorrectly configured

https://publint.dev/@mantine/[email protected]
https://publint.dev/@mantine/[email protected]
https://publint.dev/@mantine/[email protected]
https://publint.dev/@mantine/[email protected]

./esm/index.js is written in ESM, but is interpreted as CJS. Consider using the .mjs extension, e.g. ./esm/index.mjs (More info)

@CGuiho
Copy link

CGuiho commented Sep 23, 2023

I am experiencing the same issue since mantine v7 beta with remix v1.19.x!
Back with remix v1.19.x the workaround was to remove the "type": "module" from the package.json.

Now in remix v2 this workaround no longer works.

@rtivital rtivital added Fixed patch Completed issues that will be published with next patch (1.0.X) and removed Remix labels Sep 24, 2023
@rtivital
Copy link
Member

The issue will be fixed in next patch, you can view the PR of the updated application here – mantinedev/remix-template#11

@rtivital
Copy link
Member

The issue is resolved in 7.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)
Projects
None yet
Development

No branches or pull requests

5 participants