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 use import statement outside a module #1

Open
DovahBrownies opened this issue May 18, 2020 · 3 comments
Open

Cannot use import statement outside a module #1

DovahBrownies opened this issue May 18, 2020 · 3 comments

Comments

@DovahBrownies
Copy link

DovahBrownies commented May 18, 2020

I'm using the whole RSuite library in a NextJS project.
I also decided to use this well-structured library but it doesn't seem to load properly on server side.

On a server side render, I get the following error:
image

But on a client side render, it works perfectly.

This issue arises when I try to import the Validator:
import { Validator } from '@rsuite/validation'

Any advice?

Edit: I'm honored to be the first person to create an issue in this library 😆

@SevenOutman
Copy link
Member

@DovahBrownies Thank you for giving the first feedback.😃

This validation package is not well-prepared for SSR yet. I’m going to resolve this and PRs are also welcome.

@SevenOutman
Copy link
Member

@DovahBrownies The statement shown in you screenshot which threw the error came from source code of rsuite. This is weird because you should be using compiled rsuite instead of source code. What version of rsuite are you using?

@DovahBrownies
Copy link
Author

DovahBrownies commented May 21, 2020

"@rsuite/validation": "^1.2.0",
"rsuite": "^4.5.0"

@SevenOutman

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

2 participants