Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

SyntaxError: Named export 'styled' not found. The requested module '@mui/material/styles/index.js' 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:

Open
#503 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
react, typescript
Domain
frontend

Research direction

Start with the authentication-support documentation example and the stack trace location in @api-platform/admin/lib/layout/Error.js. Reproduce the error using the shown HydraAdmin setup and official Docker image, then compare the package's module imports with the reported @mui/material/styles/index.js failure. Done means the documented authentication setup renders without this server error.

Written by the indexing model from the issue text.

Description

API Platform version(s) affected: '@api-platform/admin': ^3.4.3

Description
I trying run auth on admin but I got error:

Server Error
SyntaxError: Named export 'styled' not found. The requested module '@mui/material/styles/index.js' 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 '@mui/material/styles/index.js';
const { styled } = pkg;

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
<unknown>
file:///srv/app/node_modules/.pnpm/@api-platform+admin@3.4.3_zula6vjvt3wdocc4mwcxqa6nzi/node_modules/@api-platform/admin/lib/layout/Error.js (15)
ModuleJob._instantiate
node:internal/modules/esm/module_job (124:21)
async ModuleJob.run
node:internal/modules/esm/module_job (190:5)

How to reproduce
I just using code from docs: https://api-platform.com/docs/admin/authentication-support/

Possible Solution
I don't now. Frontend has never been my strong suit

Additional Context
Using this:

import React from 'react';
import ReactDOM from 'react-dom';
import { HydraAdmin } from '@api-platform/admin';

const Admin = () => <HydraAdmin entrypoint="https://demo.api-platform.com" />;

ReactDOM.render(<Admin />, document.getElementById('root'));

I am getting exactly the same error.

I using official docker images: https://github.com/api-platform/api-platform

Dominant language
TypeScript
Stars
516
Forks
134
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from api-platform/admin

All issues in api-platform/admin

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.