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 import rrule library: TypeError: Cannot read property 'HOURLY' of undefined #430

Open
7 tasks done
blogui91 opened this issue Oct 16, 2020 · 2 comments
Open
7 tasks done

Comments

@blogui91
Copy link

blogui91 commented Oct 16, 2020

  • Verify that you've looked through existing issues for duplicates before
    creating a new one

  • Code sample reproducing the issue. Be sure to include all input values you
    are using such as the exact RRule string and dates.

        import { RRule } from 'rrule';
    
        console.log(RRule);
    
    
  • Expected output
    I should see a log with the RRule value

  • Actual output
    image

  • The version of rrule you are using
    "rrule": "^2.6.6"

  • Your operating system
    MacOS

  • Your local timezone
    Thu Oct 15 19:42:45 CDT 2020 (America/Monterrey)

Basically, I am trying to log the RRule class but i got the error above.

@olemartinorg
Copy link

I've done some research on this, as I'm getting the same error. It's baffling to me that this would crash on load, so i suspect we're in the minority with this problem.

I get this problem using rollup-plugin-commonjs-alternate, but if I switch to @rollup/plugin-commonjs everything seems to work as expected. I see @blogui91 is using webpack, which might have the same problem, but I haven't seen any details on the build setup, and I'm less familiar with webpack, so I was unable to reproduce using it.

From the emitted code, it seems this is caused by the lazy, runtime import to avoid circular refs. For me, rollup-plugin-commonjs-alternate correctly identifies that nlp/index.js should be imported when encountering the runtime import, but @rollup/plugin-commonjs fails to handle the import at all, so rrule is missing the needed code (and so it does not produce the error).

Properly resolving the circular imports should solve this. I'll take a look at it.

This was referenced Dec 14, 2020
@sciyoshi
Copy link

This is likely fixed in the new version of rrule.

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

No branches or pull requests

3 participants