fullcalendar / fullcalendar

Full-sized drag & drop event calendar in JavaScript
https://fullcalendar.io
MIT License
18.64k stars 3.62k forks source link

"Module not found" error when compiling with rrule plugin #5777

Closed acerix closed 4 years ago

acerix commented 4 years ago

Reported in https://fullcalendar.freshdesk.com/a/tickets/2127

Including the rrule plugin in the Angular example project using the example code results in "Module not found" error in compilation:

yarn run v1.22.5
$ ng build
0% compiling
Compiling @angular/core : es2015 as esm2015

Compiling @angular/common : es2015 as esm2015

Compiling @angular/platform-browser : es2015 as esm2015

Compiling @angular/platform-browser-dynamic : es2015 as esm2015

Compiling @fullcalendar/angular : es2015 as esm2015

ERROR in ./node_modules/@fullcalendar/rrule/main.js
Module not found: Error: Can't resolve 'rrule' in '/home/user/fullcalendar-example-projects/angular/node_modules/@fullcalendar/rrule'
resolve 'rrule' in '/home/user/fullcalendar-example-projects/angular/node_modules/@fullcalendar/rrule'
  Parsed request is a module
  using description file: /home/user/fullcalendar-example-projects/angular/node_modules/@fullcalendar/rrule/package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      looking for modules in /home/user/fullcalendar-example-projects/angular
        using description file: /home/user/fullcalendar-example-projects/angular/package.json (relative path: .)
          Field 'browser' doesn't contain a valid alias configuration
          using description file: /home/user/fullcalendar-example-projects/angular/package.json (relative path: ./rrule)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /home/user/fullcalendar-example-projects/angular/rrule doesn't exist
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              /home/user/fullcalendar-example-projects/angular/rrule.ts doesn't exist
            .tsx
              Field 'browser' doesn't contain a valid alias configuration
              /home/user/fullcalendar-example-projects/angular/rrule.tsx doesn't exist
            .mjs
              Field 'browser' doesn't contain a valid alias configuration
              /home/user/fullcalendar-example-projects/angular/rrule.mjs doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /home/user/fullcalendar-example-projects/angular/rrule.js doesn't exist
            as directory
              /home/user/fullcalendar-example-projects/angular/rrule doesn't exist
      /home/user/fullcalendar-example-projects/angular/node_modules/@fullcalendar/rrule/node_modules doesn't exist or is not a directory
      /home/user/fullcalendar-example-projects/angular/node_modules/@fullcalendar/node_modules doesn't exist or is not a directory
      /home/user/fullcalendar-example-projects/angular/node_modules/node_modules doesn't exist or is not a directory
      /home/user/fullcalendar-example-projects/node_modules doesn't exist or is not a directory
      /home/user/node_modules doesn't exist or is not a directory
      /home/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
      looking for modules in /home/user/fullcalendar-example-projects/angular/node_modules
        using description file: /home/user/fullcalendar-example-projects/angular/package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
          using description file: /home/user/fullcalendar-example-projects/angular/node_modules/rrule/package.json (relative path: .)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /home/user/fullcalendar-example-projects/angular/node_modules/rrule is not a file
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              /home/user/fullcalendar-example-projects/angular/node_modules/rrule.ts doesn't exist
            .tsx
              Field 'browser' doesn't contain a valid alias configuration
              /home/user/fullcalendar-example-projects/angular/node_modules/rrule.tsx doesn't exist
            .mjs
              Field 'browser' doesn't contain a valid alias configuration
              /home/user/fullcalendar-example-projects/angular/node_modules/rrule.mjs doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /home/user/fullcalendar-example-projects/angular/node_modules/rrule.js doesn't exist
            as directory
              existing directory
                use ./dist/esm/src/index.js from module in package.json
                  using description file: /home/user/fullcalendar-example-projects/angular/node_modules/rrule/package.json (relative path: .)
                    Field 'browser' doesn't contain a valid alias configuration
                    using description file: /home/user/fullcalendar-example-projects/angular/node_modules/rrule/package.json (relative path: ./dist/esm/src/index.js)
                      no extension
                        Field 'browser' doesn't contain a valid alias configuration
                        /home/user/fullcalendar-example-projects/angular/node_modules/rrule/dist/esm/src/index.js doesn't exist
                      .ts
                        Field 'browser' doesn't contain a valid alias configuration
                        /home/user/fullcalendar-example-projects/angular/node_modules/rrule/dist/esm/src/index.js.ts doesn't exist
                      .tsx
                        Field 'browser' doesn't contain a valid alias configuration
                        /home/user/fullcalendar-example-projects/angular/node_modules/rrule/dist/esm/src/index.js.tsx doesn't exist
                      .mjs
                        Field 'browser' doesn't contain a valid alias configuration
                        /home/user/fullcalendar-example-projects/angular/node_modules/rrule/dist/esm/src/index.js.mjs doesn't exist
                      .js
                        Field 'browser' doesn't contain a valid alias configuration
                        /home/user/fullcalendar-example-projects/angular/node_modules/rrule/dist/esm/src/index.js.js doesn't exist
                      as directory
                        /home/user/fullcalendar-example-projects/angular/node_modules/rrule/dist/esm/src/index.js doesn't exist
                use ./dist/es5/rrule.js from main in package.json
                  using description file: /home/user/fullcalendar-example-projects/angular/node_modules/rrule/package.json (relative path: .)
                    Field 'browser' doesn't contain a valid alias configuration
                    using description file: /home/user/fullcalendar-example-projects/angular/node_modules/rrule/package.json (relative path: ./dist/es5/rrule.js)
                      no extension
                        Field 'browser' doesn't contain a valid alias configuration
                        /home/user/fullcalendar-example-projects/angular/node_modules/rrule/dist/es5/rrule.js doesn't exist
                      .ts
                        Field 'browser' doesn't contain a valid alias configuration
                        /home/user/fullcalendar-example-projects/angular/node_modules/rrule/dist/es5/rrule.js.ts doesn't exist
                      .tsx
                        Field 'browser' doesn't contain a valid alias configuration
                        /home/user/fullcalendar-example-projects/angular/node_modules/rrule/dist/es5/rrule.js.tsx doesn't exist
                      .mjs
                        Field 'browser' doesn't contain a valid alias configuration
                        /home/user/fullcalendar-example-projects/angular/node_modules/rrule/dist/es5/rrule.js.mjs doesn't exist
                      .js
                        Field 'browser' doesn't contain a valid alias configuration
                        /home/user/fullcalendar-example-projects/angular/node_modules/rrule/dist/es5/rrule.js.js doesn't exist
                      as directory
                        /home/user/fullcalendar-example-projects/angular/node_modules/rrule/dist/es5/rrule.js doesn't exist
                using path: /home/user/fullcalendar-example-projects/angular/node_modules/rrule/index
                  using description file: /home/user/fullcalendar-example-projects/angular/node_modules/rrule/package.json (relative path: ./index)
                    no extension
                      Field 'browser' doesn't contain a valid alias configuration
                      /home/user/fullcalendar-example-projects/angular/node_modules/rrule/index doesn't exist
                    .ts
                      Field 'browser' doesn't contain a valid alias configuration
                      /home/user/fullcalendar-example-projects/angular/node_modules/rrule/index.ts doesn't exist
                    .tsx
                      Field 'browser' doesn't contain a valid alias configuration
                      /home/user/fullcalendar-example-projects/angular/node_modules/rrule/index.tsx doesn't exist
                    .mjs
                      Field 'browser' doesn't contain a valid alias configuration
                      /home/user/fullcalendar-example-projects/angular/node_modules/rrule/index.mjs doesn't exist
                    .js
                      Field 'browser' doesn't contain a valid alias configuration
                      /home/user/fullcalendar-example-projects/angular/node_modules/rrule/index.js doesn't exist

I also could not get it working in codesandbox, there I get ERROR TypeError: Cannot read property 'WEEKLY' of undefined:

https://codesandbox.io/s/suspicious-bush-1zose

acerix commented 4 years ago

Actually, same error in Typescript, so it's not Angular specific.

[./src/main.ts] 3.9 KiB {main} [built] [2 errors]
    + 19 hidden modules

ERROR in ./src/main.ts
Module not found: Error: Can't resolve '@fullcalendar/rrule' in '/home/user/fullcalendar-example-projects/typescript/src'
 @ ./src/main.ts 15:0-46 34:18-29
Jogai commented 4 years ago

The rrule project messed something up, it works if you downgrade a version, see https://github.com/jakubroztocil/rrule/issues/417

Some even downgrade further to avoid other bugs, see: https://github.com/jakubroztocil/rrule/issues/209#issuecomment-686622543

arshaw commented 4 years ago

this seems like a problem with the 3rd party rrule package, which they claim to have fixed. is anyone able to verify that things are all good?

meness commented 4 years ago

this seems like a problem with the 3rd party rrule package, which they claim to have fixed. is anyone able to verify that things are all good?

I updated to the latest version and everything works fine. You can close this issue.

arshaw commented 4 years ago

thanks

BlackBiM123 commented 3 years ago

Still have the same problem. @fullcalendar/vue": "^5.5.0", when compiling with "@fullcalendar/rrule": "^5.5.0", get Could not find module in path: 'rrule' relative to '/node_modules/@fullcalendar/rrule/main.js'. Any ways to win it?

processedbeets commented 3 years ago

What isn't clear if you follow the docs on adding rrule for Full Calendar is on their NPM install instructions it makes no mention of first having to add the rrule package itself. However, the Script install instructions show rrule being pulled in from the cdn.

I added the rrule package separately: yarn add rrule which is what '@fullcalendar/rrule needs under the hood.

Hope that helps.

spencersteiner commented 3 years ago

@processedbeets Ah yes indeed! Thanks for posting this comment. The docs do say it's a "connector" for the rrule library, but I presumed that it would handle installing rrule as a dependency for me (didn't cross my mind to install it myself) as it didn't say outright that it needed to be installed separately.

That fixed it for me, thanks!

processedbeets commented 3 years ago

brilliant glad that worked!

Laurenz1606 commented 3 years ago

still not working for me :(

favger commented 2 years ago

@processedbeets thanks. me too like this; npm install--save rrule