Skip to content

Error: require() of ES Module not supported #75

@amirhhashemi

Description

@amirhhashemi

I'm trying to use solid-aria in Astro but I get :

require() of ES Module myproject/node_modules/@solid-aria/focus/dist/cjs/index.js from myproject/node_modules/@solid-
aria/selection/dist/index.cjs not supported. index.js is treated as an ES module file as it is a .js file whose nearest parent package.json 
contains "type": "module" which declares all .js files in that package scope as ES modules. error. 

Any idea why that happens?

I'm getting this error only when using solid-aria so I asked here instead of the Astro server, And it doesn't look like an Astro issue.

Here is a small stackblitz to reproduce. The error is slightly different here but I think it's the same thing.

https://stackblitz.com/edit/github-7cxbsf?on=stackblitz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions