openblocks-dev / openblocks

🔥 🔥 🔥 The Open Source Retool Alternative
https://cloud.openblocks.dev
GNU Affero General Public License v3.0
5.88k stars 360 forks source link

openblocks-sdk does not work with nextjs #344

Closed mingfang closed 1 year ago

mingfang commented 1 year ago

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

sarike commented 1 year ago

@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.

sarike commented 1 year ago

@mingfang Try openblocks-sdk@0.0.40.

mingfang commented 1 year ago

@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?

mingfang commented 1 year ago

@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?

mingfang commented 1 year ago

@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?