Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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:

オープン
#503 コメント 5 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
react, typescript
領域
frontend

調査の方向性

認証サポートのドキュメント例と、@api-platform/admin/lib/layout/Error.js にあるスタックトレースの位置から始めます。示されている HydraAdmin のセットアップと公式の Docker イメージを使ってエラーを再現し、その後、パッケージのモジュールインポートと、@mui/material/styles/index.js で報告されている失敗を比較します。ドキュメントに記載された認証セットアップがこのサーバーエラーなしでレンダリングされれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
516
フォーク
134
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

api-platform/admin のほかの issue

api-platform/admin の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。