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

"ReferenceError: self is not defined" when using blitz #50

Open
skhashaev opened this issue Nov 7, 2021 · 3 comments
Open

"ReferenceError: self is not defined" when using blitz #50

skhashaev opened this issue Nov 7, 2021 · 3 comments
Assignees
Labels
enhancement An enhancement that doesn't translate into a feature

Comments

@skhashaev
Copy link

Expected Behavior

Should show me the table with the data

Actual Behavior

Throwin error "ReferenceError: self is not defined"

Steps to Reproduce

Import the package and writing <SmartDataTable /> in the render function

Screenshot

image

Your Environment

Blitz.js is the fullstack framework includes Node.js, Next.js (Server-side rendering), React and Prisma.

@joaocarmo joaocarmo self-assigned this Nov 7, 2021
@joaocarmo joaocarmo added the bug Bug report label Nov 7, 2021
@joaocarmo
Copy link
Owner

Thank you for submitting this issue!

I will stop transpiling the library to ES5 and it should fix this issue. Since it uses React and JSX, it will always require transpiling anyway.

@skhashaev
Copy link
Author

I found the solution. I can use the dynamic import for the component, where I use the SmartDataTable. For example, I have a component Table, where I use SmartDataTable, and I can dynamically import the Table component, and there will be no issue.

https://blitzjs.com/docs/code-splitting - docs about dynamic import in Blitz.js.

I don't think that the bug or something, and the package is just not made for SSR. You can add SSR support. I'm sure it will help for people. Thank you for response.

@joaocarmo
Copy link
Owner

Thank you for sharing your solution, @skhashaev! I'll see how I can support SSR as those technologies are becoming more popular. For the meantime, I can link this issue on the documentation.

@joaocarmo joaocarmo added enhancement An enhancement that doesn't translate into a feature and removed bug Bug report labels Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement that doesn't translate into a feature
Projects
None yet
Development

No branches or pull requests

2 participants