openblocks-dev/openblocks

openblocks-sdk does not work with nextjs

mingfang opened this issue · 5 comments

openblocks-sdk does not work with nextjs.
Getting this error

error - ReferenceError: window is not defined
    at file:///home/projector-user/IdeaProjects/next-openblocks-test/node_modules/openblocks-sdk/dist/36af6c29.js:2239:53
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
  page: '/'
}

I create this repo to demonstrate the problem.
https://github.com/mingfang/next-openblocks-test

@mingfang Thanks for reporting this, I will release a new version of SDK soon.

But it can only be used as dynamic import as well.

@mingfang Try openblocks-sdk@0.0.40.

@sarike
I can confirm that dynamic import works now. Thanks.
Please push the code.

Also are there plans to make the sdk work without dynamic import?

@sarike
I can confirm that dynamic import works now. Thanks.
Please push the code.

Also are there plans to make the sdk work without dynamic import?

@sarike
I can confirm that dynamic import works now. Thanks.
Please push the code.

Also are there plans to make the sdk work without dynamic import?