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

Cannot create property 'Symbol(level)' on string #6877

Closed
gempain opened this issue Mar 29, 2024 · 3 comments
Closed

Cannot create property 'Symbol(level)' on string #6877

gempain opened this issue Mar 29, 2024 · 3 comments

Comments

@gempain
Copy link
Contributor

gempain commented Mar 29, 2024

Bug report

Describe the bug

Trying to enable the multi warehouse module, I get an error when running:

node ./node_modules/@medusajs/medusa/dist/scripts/migrate-inventory-items.js
info:    Processing inventory-item.created which has 0 subscribers
/git/my-medusa-store/node_modules/winston/lib/winston/logger.js:214
      level[LEVEL] = level.level;
                   ^

TypeError: Cannot create property 'Symbol(level)' on string 'Processed 29 of 29'
    at DerivedLogger.log (/git/my-medusa-store/node_modules/winston/lib/winston/logger.js:214:20)
    at Reporter.log (/git/my-medusa-store/node_modules/@medusajs/medusa-cli/dist/reporter/index.js:271:34)
    at /git/my-medusa-store/node_modules/@medusajs/medusa/dist/scripts/migrate-inventory-items.js:194:38
    at step (/git/my-medusa-store/node_modules/@medusajs/medusa/dist/scripts/migrate-inventory-items.js:33:23)
    at Object.next (/git/my-medusa-store/node_modules/@medusajs/medusa/dist/scripts/migrate-inventory-items.js:14:53)
    at fulfilled (/git/my-medusa-store/node_modules/@medusajs/medusa/dist/scripts/migrate-inventory-items.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

System information

Medusa version (including plugins):

    "@medusajs/admin": "7.1.11",
    "@medusajs/cache-inmemory": "^1.8.9",
    "@medusajs/cache-redis": "^1.8.9",
    "@medusajs/event-bus-local": "^1.9.8",
    "@medusajs/event-bus-redis": "^1.8.11",
    "@medusajs/file-local": "^1.0.3",
    "@medusajs/inventory": "^1.11.6",
    "@medusajs/medusa": "1.20.2",
    "@medusajs/medusa-cli": "^1.3.22",
    "@medusajs/stock-location": "^1.11.5",

Node.js version:
Database: Postgres
Operating system: Mac
Browser (if relevant): Chrome

Steps to reproduce the behavior

  1. Create a new medusa store backend
  2. Install inventory and stock location modules as explained here. Run migrations.
  3. Run node ./node_modules/@medusajs/medusa/dist/scripts/migrate-inventory-items.js

Expected behavior

I would expect no error.

Screenshots

Code snippets

Additional context

@gempain
Copy link
Contributor Author

gempain commented Mar 29, 2024

The issue was coming from calls to logger.log in migrate-inventory-items.ts. I changed them to log.info and things worked fine.

sradevski added a commit that referenced this issue Mar 29, 2024
* fix(inventory): cannot migrate existing products (#6877)

* chore: add changeset (#6821)

---------

Co-authored-by: Geoffroy Empain <[email protected]>
Co-authored-by: Stevche Radevski <[email protected]>
@jbeckton
Copy link

same issue with me as well...

C:\Users\User\Projects\local-area-marketplace\node_modules\winston\lib\winston\logger.js:214
      level[LEVEL] = level.level;
                   ^

TypeError: Cannot create property 'Symbol(level)' on string 'Processed 8 of 8'
    at DerivedLogger.log (C:\Users\User\Projects\local-area-marketplace\node_modules\winston\lib\winston\logger.js:214:20)
    at Reporter.log (C:\Users\User\Projects\local-area-marketplace\node_modules\@medusajs\medusa-cli\dist\reporter\index.js:271:34)
    at C:\Users\User\Projects\local-area-marketplace\node_modules\@medusajs\medusa\dist\scripts\migrate-inventory-items.js:194:38
    at step (C:\Users\User\Projects\local-area-marketplace\node_modules\@medusajs\medusa\dist\scripts\migrate-inventory-items.js:33:23)
    at Object.next (C:\Users\User\Projects\local-area-marketplace\node_modules\@medusajs\medusa\dist\scripts\migrate-inventory-items.js:14:53)
    at fulfilled (C:\Users\User\Projects\local-area-marketplace\node_modules\@medusajs\medusa\dist\scripts\migrate-inventory-items.js:5:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.17.1

@vitzaoral
Copy link

I had the same problem. I commented out all the logger_1.default.log(...) code in migrate-inventory-items.js file and the migration went fine 🤷🏼‍♂️

.... // logger_1.default.log("Proces .... ....

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

No branches or pull requests

4 participants