Netlify-cms: Can't Upload new image in media

Created on 5 Jul 2019  Â·  24Comments  Â·  Source: netlify/netlify-cms

Describe the bug
I try to upload in www my web com/admin a new media files, e.g. new photo.jpg then when i choose one and confirm, i get this message in console:

netlify-cms-app.js:25020 Uncaught (in promise) TypeError: Cannot read property 'toLowerCase' of undefined at netlify-cms-app.js:25020 at u (runtime.js:63) at Generator._invoke (runtime.js:282) at Generator.e.<computed> [as next] (runtime.js:116) at asyncGeneratorStep (netlify-cms-app.js:407) at a (netlify-cms-app.js:409) at netlify-cms-app.js:409 at new Promise (<anonymous>) at netlify-cms-app.js:409 at netlify-cms-app.js:25100

-- I don't have this problem in my localhost, i can upload any image with any problem.

  • Netlify CMS version: ^2.9.1
  • Git provider: https://github.com/rjulia/tximak-cms
    "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.19", "@fortawesome/free-brands-svg-icons": "^5.9.0", "@fortawesome/free-regular-svg-icons": "^5.9.0", "@fortawesome/free-solid-svg-icons": "^5.9.0", "@fortawesome/react-fontawesome": "^0.1.4", "bulma": "^0.7.0", "gatsby": "^2.7.3", "gatsby-image": "^2.0.23", "gatsby-plugin-netlify": "^2.0.6", "gatsby-plugin-netlify-cms": "^4.0.0", "gatsby-plugin-prefetch-google-fonts": "^1.4.2", "gatsby-plugin-purgecss": "^3.1.0", "gatsby-plugin-react-helmet": "^3.0.4", "gatsby-plugin-sass": "^2.0.7", "gatsby-plugin-sharp": "^2.1.1", "gatsby-remark-copy-linked-files": "^2.0.7", "gatsby-remark-images": "^3.0.1", "gatsby-remark-relative-images": "^0.2.1", "gatsby-source-filesystem": "^2.0.26", "gatsby-transformer-remark": "^2.3.4", "gatsby-transformer-sharp": "^2.1.9", "lodash": "^4.17.5", "lodash-webpack-plugin": "^0.11.4", "netlify-cms-app": "^2.9.1", "netlify-cms-media-library-cloudinary": "^1.3.2", "netlify-cms-media-library-uploadcare": "^0.5.2", "node-sass": "^4.11.0", "parcel-bundler": "^1.12.3", "prop-types": "^15.6.0", "react": "^16.8.4", "react-cookie": "^4.0.0", "react-dom": "^16.8.4", "react-facebook": "^8.0.4", "react-google-maps": "^9.4.5", "react-helmet": "^5.2.0", "react-share": "^3.0.0", "react-slick": "^0.24.0", "slick-carousel": "^1.8.1", "uuid": "^3.2.1"

Most helpful comment

Had the same issue. Updating packages seems to have fixed it.

From:

"gatsby-plugin-netlify": "^2.0.6",
"gatsby-plugin-netlify-cms": "^4.0.0",
"gatsby-plugin-netlify-cms-paths": "^1.2.1",

To:

"gatsby-plugin-netlify": "^2.1.1",
"gatsby-plugin-netlify-cms": "^4.1.2",
"gatsby-plugin-netlify-cms-paths": "^1.2.2",

All 24 comments

I’m also having this problem! (Same TypeError in console)

I am having the same issue. Any idea why this is happening?

Not able to reproduce. The person that raised the issue deleted the questions in the issue template, so I'm a bit in the dark. Can folks confirm what version of the CMS you're using, backend, maybe some of your config?

Sorry, i already put here the link to my code Git provider: https://github.com/rjulia/tximak-cms, CMS version Netlify CMS version: ^2.9.1, Don't you can access?

@rjulia we need the version logged in your console when you load the CMS - ^2.9.1 could be any version between 2.9.1 and 2.9.5. We ask specific questions in the issue template to save maintainers time when debugging, namely the specific version of the CMS you're using and the backend that you're experiencing the issue with (provided by pasting the config you were using when the bug occurred). Linking to your repo isn't a viable response, as you may be experiencing the issue on a specific branch, or may have changed something since you saw the bug.

Again, I can't reproduce. Can anyone give details on the exact circumstances under which you're experiencing this issue?

I am using 2.9.5 with Gatsby using the github provider

Sorry, my apologies to give you guys bad information i will try next time to do better. I am using 2.9.1 with Gatsby using the github provider, besides , I linked my report because I wasn't changed anything, so i got this problem in the master branch. I also created yesterday a NEW SITE FROM GIT from the same repository and It got the same issue.

  • so the circumstances are if i try to upload new in https://followfun.es/admin/#/collections/common, i get the error you can see in the image, but if i do from here http://localhost:8000/admin/#/collections/common I don't have any problem, I can upload all the images I want and all the things works fine.
    So the problem is in production, online but localhost.
    Screenshot 2019-07-06 at 10 08 40

I also created a new site using gatsby-starter-netlify-cms just now, still unable to reproduce.

I need someone to give steps to reproduce.

This means steps that any developer can follow to reliably trigger this bug.

Having the same issue here. Works locally. From netlify

netlify-cms-app.js:24735 Uncaught (in promise) TypeError: Cannot read property 'toLowerCase' of undefined
    at netlify-cms-app.js:24735
    at u (runtime.js:63)
    at Generator._invoke (runtime.js:282)
    at Generator.e.<computed> [as next] (runtime.js:116)
    at asyncGeneratorStep (netlify-cms-app.js:137)
    at a (netlify-cms-app.js:139)
    at netlify-cms-app.js:139
    at new Promise (<anonymous>)
    at netlify-cms-app.js:139
    at netlify-cms-app.js:24815

dependencies:

"dependencies": {
    "gatsby": "^2.13.4",
    "gatsby-plugin-netlify-cms": "^4.1.1",
    "netlify-cms-app": "^2.9.5",
    "react": "^16.8.6",
    "react-dom": "^16.8.6"
  }

Followed step-by-step Sourcing from Netlify CMS - Gatsby.js added an image widget to the config.yml

      - label: "Featured Image"
        name: "thumbnail"
        widget: "image"
        default: "/uploads/Brakspear-s-01.jpg"
        media_library:
          config:
            multiple: true

Could it have anything to do with having to set the Environment variables: NODE_OPTIONS = --max_old_space_size=4096 which I do to prevent build errors?

The media library option on the widget is only for use with Cloudinary or Uploadcare, can you try removing that?

Sent with GitHawk

I can try but pretty sure I had it without and showed the same result?

Can you help me reproduce? A repo I can clone/fork to see the issue firsthand?

Sent with GitHawk

I'm just starting afresh with gatsby-hello-world

https://github.com/gatsbyjs/gatsby-starter-hello-world
This has the same problem Cannot read property 'toLowerCase' of undefined
Again I had to add NODE_OPTIONS = --max-old-space-size=4096 otherwise the build fails.

I need to know exact steps to follow to reproduce this. Here's an article on what that entails: https://stackoverflow.com/help/minimal-reproducible-example

Sent with GitHawk

Again, I'm really trying to help here, but we're now talking about multiple issues, and since the original post for this issue deleted the issue template that includes a place for steps to reproduce, the purpose of it is no longer clear. It may be best to close this issue and create a new one that properly completes the issue template, but I'll hold off on doing so if proper steps to reproduce can be provided here.

Sent with GitHawk

Will do, thanks

@erquhart I appreciate your effort I also try to help to resolved, but I don't kwon how I can give you more information if in my local works, if you want ask me some especific question, or @jamesgrubb can open a new and you can closed this one.

i tried all my browsers this is the result:
MacOs Mojave 10.14.5
Safari V.12.1.1 _Doesn’t work_.

Google chrome Version 75.0.3770.100 (Official Build) (64-bit) _Doesn’t work._

TypeError: Cannot read property 'toLowerCase' of undefined
at netlify-cms-app.js:24735
Brave Version 0.65.118 Chromium: 75.0.3770.80 (Official Build) (64-bit) _Doesn’t work._


TypeError: Cannot read property 'toLowerCase' of undefined
at netlify-cms-app.js:24735

PC Windows 10 home
Google chrome Version 75.0.3770.100 (Official Build) (64-bit) _Doesn’t work._
TypeError: Cannot read property 'toLowerCase' of undefined
at netlify-cms-app.js

Firefox 66.0.3 (64-bit) _Doesn’t work._
Unhandled promise rejection TypeError: "e.name is undefined"

Microsoft EdgeHTML 17.17134 _Doesn’t work._
Unhandled promise rejection TypeError: Unable to get property 'toLowerCase' of undefined or null reference
es6.promise.js (109,10)

That makes four of us that have reported the same issue. There is definitely something here, just a matter of getting solid steps to reproduce. I copied my config.yml over from the affected repo and I still was unable to reproduce. I looked into the error and it looks like it is expecting the upload to be an object, but it is getting an array of objects so it can't find what it is looking for.
image
My guess is we have dependency version issues, but I am still testing that theory.

Same issue here. Works fine on localhost but not when uploaded.

Uncaught (in promise) TypeError: Cannot read property 'toLowerCase' of undefined
    at _callee19$ (netlify-cms.js:24800)
    at tryCatch (runtime.js:81)
    at Generator.invoke [as _invoke] (runtime.js:300)
    at Generator.prototype.<computed> [as next] (runtime.js:134)
    at asyncGeneratorStep (netlify-cms.js:137)
    at _next (netlify-cms.js:139)
    at netlify-cms.js:139
    at new Promise (<anonymous>)
    at netlify-cms.js:139
    at netlify-cms.js:24880

Had the same issue. Updating packages seems to have fixed it.

From:

"gatsby-plugin-netlify": "^2.0.6",
"gatsby-plugin-netlify-cms": "^4.0.0",
"gatsby-plugin-netlify-cms-paths": "^1.2.1",

To:

"gatsby-plugin-netlify": "^2.1.1",
"gatsby-plugin-netlify-cms": "^4.1.2",
"gatsby-plugin-netlify-cms-paths": "^1.2.2",

Yes, fixed here, too.

Yes, i fixed to mee as well, thank you @brianlmacdonald

Was this page helpful?
0 / 5 - 0 ratings