next.js комментарий модуля npm, выдающий ошибку

#reactjs #syntax #next.js

Вопрос:

Это моя ошибка

 10:03:56.049    ./components/navbar.js
10:03:56.049    13:33  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
10:03:56.049    39:33  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
10:03:56.049    Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
10:03:56.051    info  - Creating an optimized production build...
10:04:04.307    Failed to compile.
10:04:04.308    HookWebpackError: Unexpected '/'. Escaping special characters with  may help.
10:04:04.308    > Build error occurred
10:04:04.309    Error: > Build failed because of webpack errors
10:04:04.309        at /vercel/path0/node_modules/next/dist/build/index.js:15:924
10:04:04.309        at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/telemetry/trace/trace.js:6:584)
10:04:04.333    Error: Command "npm run build" exited with 1
 

Сначала я подумал, что это исходит от navbar.js , но я не вижу там никаких «специальных символов», вот мой navbar.js: https://pastebin.com/8XFUtL5A

Итак, я пошел и проверил node_modules/next/dist/telemetry/trace/trace.js:6:584 , и я нашел там много комментариев: https://pastecord.com/epygazosib.js

Итак, как мне устранить эту ошибку? Потому что я видел аналогичную ошибку у кого-то другого, но они используют угловой

Ответ №1:

Я исправил это, просто удалив все комментарии во всех моих css-файлах