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

Can't resolve 'codemirror/lib/codemirror.css' in project/node_modules/netlify-cms-widget-code/dist/esm #5221

Closed
PetroPavlenko opened this issue Apr 6, 2021 · 6 comments

Comments

@PetroPavlenko
Copy link
Contributor

PetroPavlenko commented Apr 6, 2021

fails during development gatsby develop. Missed codemirror dependency and netlify-cms-lib-widgets

Screenshots
Знімок екрана 2021-04-06 о 16 16 07

Applicable Versions:
without yarn.lock and using fresh node_modules

  System:
    OS: macOS 11.2.1
    CPU: (8) x64 Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.5.0 - /var/folders/gb/6zmvh1p14lgb_ckkttst8vxm0000gn/T/yarn--1617714475932-0.8966946508359208/node
    Yarn: 1.22.5 - /var/folders/gb/6zmvh1p14lgb_ckkttst8vxm0000gn/T/yarn--1617714475932-0.8966946508359208/yarn
    npm: 6.14.5 - ~/.nvm/versions/node/v14.5.0/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 89.0.4389.114
    Safari: 14.0.3
  npmPackages:
    gatsby: ^2.30.1 => 2.32.11 
    gatsby-image: ^2.9.0 => 2.11.0 
    gatsby-plugin-catch-links: ^2.3.15 => 2.10.0 
    gatsby-plugin-layout: ^1.3.13 => 1.10.0 
    gatsby-plugin-loadable-components-ssr: ^2.1.0 => 2.1.0 
    gatsby-plugin-netlify: ^2.11.1 => 2.11.1 
    gatsby-plugin-netlify-cms: ^4.10.0 => 4.10.0 
    gatsby-plugin-react-helmet: ^3.3.14 => 3.10.0 
    gatsby-plugin-react-svg: ^3.0.0 => 3.0.0 
    gatsby-plugin-robots-txt: ^1.5.1 => 1.5.5 
    gatsby-plugin-sharp: ^2.12.0 => 2.14.3 
    gatsby-plugin-sitemap: ^2.10.0 => 2.12.0 
    gatsby-plugin-styled-components: ^3.3.10 => 3.10.0 
    gatsby-plugin-tsconfig-paths: ^1.0.2 => 1.0.2 
    gatsby-plugin-typescript: ^2.4.24 => 2.12.1 
    gatsby-plugin-webpack-bundle-analyser-v2: ^1.1.13 => 1.1.21 
    gatsby-remark-copy-linked-files: ^2.3.19 => 2.10.0 
    gatsby-remark-images: ^3.9.0 => 3.11.1 
    gatsby-remark-relative-images: ^2.0.2 => 2.0.2 
    gatsby-remark-sub-sup: ^1.0.0 => 1.0.0 
    gatsby-source-filesystem: ^2.3.36 => 2.11.1 
    gatsby-transformer-remark: ^2.8.46 => 2.16.1 
    gatsby-transformer-sharp: ^2.10.0 => 2.12.1 

"netlify-cms-app": "^2.14.38",
"netlify-identity-widget": "^1.9.1",
@PetroPavlenko PetroPavlenko added the type: bug code to address defects in shipped code label Apr 6, 2021
@erezrokah
Copy link
Contributor

Hi @PetroPavlenko, can you please share steps to reproduce the issue per our issue template?

@PetroPavlenko
Copy link
Contributor Author

PetroPavlenko commented Apr 6, 2021

sure. So basically

  • run netlify-cms-proxy-server
  • code to reproduce
import CMS from "netlify-cms-app";

const config: NetlifyCms.CmsConfig = {
    backend: {
      name: "git-gateway",
      commit_messages: {
        create: "Create {{collection}} “{{slug}}”",
        update: "Update {{collection}} “{{slug}}”",
        delete: "Delete {{collection}} “{{slug}}”",
        uploadMedia: "[skip ci] Upload “{{path}}”",
        deleteMedia: "[skip ci] Delete “{{path}}”",
      },
    },
    publish_mode: undefined,
    local_backend: true,
    media_folder: "static/img",
    public_folder: "/img",
    collections: [
      termsCollection,
      blogsCollection,
      guidesCollection,
      {
        name: "pages",
        label: "Custom pages",
        files: [
          aboutPageConfig,
          homePageConfig,
        ],
      },
    ],
  };
  
  
CMS.init({ config });

with dependencies above.

This was working with "netlify-cms-app": "^2.14.10". But it doesn't work with 2.14.38 and with 2.14.20

@arpadgabor
Copy link
Contributor

Experiencing a similar issue here but with Nuxt, also with JS initialization of the CMS.

These dependencies were not found:
 
* ajv/dist/compile/codegen in ./node_modules/ajv-errors/dist/index.js
* ajv/dist/compile/codegen/code in ./node_modules/ajv-errors/dist/index.js
* ajv/dist/compile/errors in ./node_modules/ajv-errors/dist/index.js
* ajv/dist/compile/names in ./node_modules/ajv-errors/dist/index.js
* ajv/dist/compile/validate in ./node_modules/ajv-errors/dist/index.js
* netlify-cms-backend-proxy in ./node_modules/netlify-cms-app/dist/esm/extensions.js
* netlify-cms-lib-widgets in ./node_modules/netlify-cms-core/dist/esm/backend.js, ./node_modules/netlify-cms-core/dist/esm/components/Collection/NestedCollection.js and 6 others
  • netlify-cms: 2.10.105 (also tried 2.10.99 and 2.10.111)
  • nuxt: 2.15.4

I suspect this might be cause by how my package-lock is formed. If I try updating netlify-cms it breaks again, but if I revert back to a commit with a working lockfile, it starts working again.

I'll try getting a sample repo in the weekend.

@erezrokah
Copy link
Contributor

Thanks for the additional info @arpadgabor, I'll try to set up a reproduction, but if someone provides a public repo that will make it much easier to reproduce.

@erezrokah erezrokah self-assigned this Apr 12, 2021
@arpadgabor
Copy link
Contributor

arpadgabor commented Apr 12, 2021

Hey @erezrokah , here is a test repo I created. I've also set up a workflow to test changes on PR's if that helps.

As you can see in the workflow, in the failing action the only difference is that I remove the package-lock.json file before installing the dependencies again.

@erezrokah
Copy link
Contributor

erezrokah commented Apr 13, 2021

This should be fixed in netlify-cms@2.10.114 and netlify-cms-app@2.14.43.

Closing the issue - please comment if the problem still happens with the new versions.

Thanks everyone for reporting and @arpadgabor for the reproduction.

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

3 participants