clh161 / react-router-sitemap-generator

15 stars 11 forks source link

I have an error while , running yarn run babel-node sitemap.js #148

Open ryotaro-tenya0727 opened 2 years ago

ryotaro-tenya0727 commented 2 years ago

This is my error

$ yarn run babel-node sitemap.js
yarn run v1.22.18
$ /Users/ryotaro/Desktop/program_study/portforio/frontend/node_modules/.bin/babel-node sitemap.js
/Users/ryotaro/Desktop/program_study/portforio/frontend/node_modules/react-medium-image-zoom/dist/styles.css:1
[data-rmiz-wrap="visible"],
 ^^^^^^^^^^^^^^

SyntaxError: Invalid left-hand side in assignment
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1026:15)
    at Module._compile (node:internal/modules/cjs/loader:1061:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
    at Object.newLoader [as .js] (/Users/ryotaro/Desktop/program_study/portforio/frontend/node_modules/pirates/lib/index.js:141:7)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/ryotaro/Desktop/program_study/portforio/frontend/src/components/pages/GeneralDiaryShow.jsx:11:1)

Node.js v17.5.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Routers.jsx

import { memo } from 'react';
import { Routes, Route } from 'react-router-dom';

import {
  AdminUsers,
  Home,
  MyPage,
  RecommenedMembersNew,
  RecommenedMemberDiariesNew,
  RecommenedMemberDiaries,
  RecommenedMemberDiaryShow,
  RecommendedMemberDiaryEdit,
  RecommenedMemberEdit,
  PrivacyPolicy,
  TermsOfService,
  GeneralDiaryShow,
  Page404,
  AdminUserDiaries,
  Users,
  TimeLine,
} from '../components/pages/Pages';

export const Routers = memo(() => {
  return (
    <Routes>
      <Route path='/' element={<Home />} />
      <Route path='/admin' element={<AdminUsers />} />
      <Route path='/admin/:user_id/diaries' element={<AdminUserDiaries />} />
      <Route path='/mypage' element={<MyPage />} />
      <Route path='/privacy-policy' element={<PrivacyPolicy />} />
      <Route path='/term-of-service' element={<TermsOfService />} />
      <Route path='/diaries/show/:diary_id' element={<GeneralDiaryShow />} />
      <Route path='/users' element={<Users />} />
      <Route path='/timeline' element={<TimeLine />} />
      <Route path='*' element={<Page404 />} />
      <Route
        path='/recommended-members/new'
        element={<RecommenedMembersNew />}
      />
      <Route path='/recommended-member/:recommended_member_uuid'>
        <Route path='edit/:recommended_member_id'>
          <Route index element={<RecommenedMemberEdit />} />
        </Route>
      </Route>
      <Route path='/recommended-member/:recommended_member_uuid/diaries'>
        <Route path=':recommended_member_id'>
          <Route index element={<RecommenedMemberDiaries />} />
          <Route path='new'>
            <Route index element={<RecommenedMemberDiariesNew />} />
          </Route>
          <Route path='edit'>
            <Route path=':diary_id'>
              <Route index element={<RecommendedMemberDiaryEdit />} />
            </Route>
          </Route>
          <Route path='show'>
            <Route path=':diary_id'>
              <Route index element={<RecommenedMemberDiaryShow />} />
            </Route>
          </Route>
        </Route>
      </Route>
    </Routes>
  );
});