Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organizing categories leads to error #8109

Closed
akoenig opened this issue Jul 12, 2024 · 13 comments · Fixed by #8599
Closed

Organizing categories leads to error #8109

akoenig opened this issue Jul 12, 2024 · 13 comments · Fixed by #8599

Comments

@akoenig
Copy link

akoenig commented Jul 12, 2024

Bug report

Describe the bug

When navigating to http://localhost:9000/app/categories/organize (on a fresh app, bootstrapped via create-medusa-app@preview), the following error occurs:

Error: Element type is invalid

System information

Medusa version (including plugins): 2.0.1-preview
Node.js version: v22.2.0
Database: Postgres 12
Operating system: -
Browser (if relevant): -

Steps to reproduce the behavior

  1. Go to 'http://localhost:9000/app/categories/organize'
  2. See error

Expected behavior

The UI for organizing the categories should appear.

Screenshots

image

Code snippets

n/a

Additional context

n/a

@sradevski
Copy link
Member

Thanks for the report, we'll have a look into it!

@Marwan-Dalaty
Copy link

Marwan-Dalaty commented Jul 13, 2024

HI Same issue here, I'm able to open the category and browse the default item inside it http://localhost:9000/app/categories
but when I try to add a new category I'm getting the above error.

Screenshot from 2024-07-13 20-28-10

please advise

@LRboyz
Copy link

LRboyz commented Jul 23, 2024

When will this problem be solved? It's urgent.🔥

@Deroswent
Copy link

The same bug when you try to create category.

This bug is blocker, please take a look and fix it

@Marwan-Dalaty
Copy link

@sradevski @shahednasser, Please check the above as it wasn't included in the new release and is a critical fix.
Also kindly note that if you change the category name, it doesn't reflect the new name in the storefront UI

@Marwan-Dalaty
Copy link

Hi why we are not getting reply from Medusa team on this ticket?

@HarleySalas
Copy link

Can we at least have some response as to why it hasn't been assigned? Did you guys forget about it? @sradevski @srindom

@sradevski
Copy link
Member

sradevski commented Aug 6, 2024

Hey all, it hasn't been forgotten, it's just a matter of priorities. We'll tackle it as soon as the other, higher priority work, is done.

@chasie
Copy link

chasie commented Aug 14, 2024

Hi all, this problem has already been solved by the community in the Discord channel (https://discord.gg/medusajs):

  1. Add vite-plugin-commonjs as dev dependency
  2. Add this in medusa-config.js
  admin: {
    // your code
    vite: () => ({
      plugins: [
        commonjs({
          filter: (id) => /node_modules\/react-nestable/.test(id),
        }),
      ],
    }),
  },

@Deroswent
Copy link

Deroswent commented Aug 14, 2024

Hi all, this problem has already been solved by the community in the Discord channel (https://discord.gg/medusajs):

It doesn't work. Clear medusa preview installation + npm install -D vite-plugin-commonjs + change standard medusa-config.js = error when start medusa develop: ReferenceError: commonjs is not defined

medusa-config.js:

import { loadEnv, defineConfig } from '@medusajs/utils'

loadEnv(process.env.NODE_ENV, process.cwd())

module.exports = defineConfig({
  projectConfig: {
    databaseUrl: process.env.DATABASE_URL,
    http: {
      storeCors: process.env.STORE_CORS,
      adminCors: process.env.ADMIN_CORS,
      authCors: process.env.AUTH_CORS,
      jwtSecret: process.env.JWT_SECRET || "supersecret",
      cookieSecret: process.env.COOKIE_SECRET || "supersecret",
    }
  },
  admin: {
    vite: () => ({
      plugins: [
        commonjs({
          filter: (id) => /node_modules\/react-nestable/.test(id),
        }),
      ],
    }),
  },
});

@chasie
Copy link

chasie commented Aug 15, 2024

Hi all, this problem has already been solved by the community in the Discord channel (https://discord.gg/medusajs):

It doesn't work. Clear medusa preview installation + npm install -D vite-plugin-commonjs + change standard medusa-config.js = error when start medusa develop: ReferenceError: commonjs is not defined

medusa-config.js:

import { loadEnv, defineConfig } from '@medusajs/utils'

loadEnv(process.env.NODE_ENV, process.cwd())

module.exports = defineConfig({
  projectConfig: {
    databaseUrl: process.env.DATABASE_URL,
    http: {
      storeCors: process.env.STORE_CORS,
      adminCors: process.env.ADMIN_CORS,
      authCors: process.env.AUTH_CORS,
      jwtSecret: process.env.JWT_SECRET || "supersecret",
      cookieSecret: process.env.COOKIE_SECRET || "supersecret",
    }
  },
  admin: {
    vite: () => ({
      plugins: [
        commonjs({
          filter: (id) => /node_modules\/react-nestable/.test(id),
        }),
      ],
    }),
  },
});

Pls add import: import commonjs from 'vite-plugin-commonjs'

@Deroswent
Copy link

Pls add import: import commonjs from 'vite-plugin-commonjs'

Thanks, after I added this - no more error when starting medusa develop, but I still receive error Error: Element type is invalid when try to edit ranking or create category.

So, unfortunately this solution doesn't work

@olivermrbl
Copy link
Contributor

We expect to land a fix today and publish a new release. Keep an eye out for our releases :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants