medusajs / medusa

Building blocks for digital commerce
https://medusajs.com
MIT License
24.67k stars 2.43k forks source link

Organizing categories leads to error #8109

Closed akoenig closed 1 month ago

akoenig commented 2 months ago

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 commented 2 months ago

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

Marwan-Dalaty commented 2 months ago

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 commented 1 month ago

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

Deroswent commented 1 month ago

The same bug when you try to create category.

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

Marwan-Dalaty commented 1 month ago

@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 commented 1 month ago

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

HarleySalas commented 1 month ago

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

sradevski commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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