nft-gallery icon indicating copy to clipboard operation
nft-gallery copied to clipboard

can't build with latest main

Open petersopko opened this issue 2 years ago • 6 comments

tried everything I could think of up to this point:

  • reinstalling pnpm
  • making sure I have same version as @vikiival (7.3.0)
  • deleting and cloning app again
  • turning off and on (everything 😆)
  • clean install from latest main fork

doesn't build anyways. Anybody facing similar errors/got any idea how to get around this?

 ERROR  in ./node_modules/@substrate/smoldot-light/dist/mjs/index-browser.js                                                                                                                   friendly-errors 13:40:11  

Module parse failed: Unexpected token (38:43)                                                                                                                                                  friendly-errors 13:40:11  
File was processed with these loaders:
 * ./node_modules/unplugin/dist/webpack/loaders/transform.js
 * ./node_modules/@open-wc/webpack-import-meta-loader/webpack-import-meta-loader.js
You may need an additional loader to handle the result of these loaders.
|         },
|         connect: (config) => {
>             return connect(config, options?.forbidWs || false, options?.forbidNonLocalWs || false, options?.forbidWss || false);
|         }
|     });
                                                                                                                                                                                               friendly-errors 13:40:11  
 @ ./node_modules/@substrate/connect/dist/mjs/connector/smoldot-light.js 7:19-53
 @ ./node_modules/@substrate/connect/dist/mjs/connector/index.js
 @ ./node_modules/@substrate/connect/dist/mjs/index.js
 @ ./node_modules/@polkadot/rpc-provider/substrate-connect/ScProvider.js
 @ ./node_modules/@polkadot/rpc-provider/substrate-connect/index.js
 @ ./node_modules/@polkadot/rpc-provider/bundle.js
 @ ./node_modules/@polkadot/rpc-provider/index.js
 @ ./node_modules/@polkadot/api/bundle.js
 @ ./node_modules/@polkadot/api/index.js
 @ ./node_modules/@kodadot1/sub-api/dist/index.mjs
 @ ./node_modules/unplugin/dist/webpack/loaders/transform.js??ref--44-0!./node_modules/unplugin/dist/webpack/loaders/transform.js??ref--46-0!./node_modules/babel-loader/lib??ref--0-0!./node_modules/@nuxt/webpack-edge/
node_modules/vue-loader/lib??vue-loader-options!./node_modules/unplugin-vue2-script-setup/node_modules/unplugin/dist/webpack/loaders/transform.js??ref--19-0!./node_modules/unplugin/dist/webpack/loaders/transform.js??ref--45-0!./components/unique/Collection/Item/CollectionItem.vue?vue&type=script&lang=ts&
 @ ./components/unique/Collection/Item/CollectionItem.vue?vue&type=script&lang=ts&
 @ ./components/unique/Collection/Item/CollectionItem.vue
 @ ./node_modules/unplugin/dist/webpack/loaders/transform.js??ref--44-0!./node_modules/unplugin/dist/webpack/loaders/transform.js??ref--46-0!./node_modules/babel-loader/lib??ref--0-0!./node_modules/@nuxt/webpack-edge/
node_modules/vue-loader/lib??vue-loader-options!./node_modules/unplugin-vue2-script-setup/node_modules/unplugin/dist/webpack/loaders/transform.js??ref--19-0!./node_modules/unplugin/dist/webpack/loaders/transform.js??ref--45-0!./pages/statemine/collection/_id.vue?vue&type=script&lang=ts&
 @ ./pages/statemine/collection/_id.vue?vue&type=script&lang=ts&
 @ ./pages/statemine/collection/_id.vue
 @ ./.nuxt/router.js
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi ./node_modules/@nuxt/bridge/dist/runtime/capi.plugin.mjs ./node_modules/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js

petersopko avatar Jul 28 '22 11:07 petersopko

just a note, this became a problem after

  • #3500

petersopko avatar Jul 28 '22 11:07 petersopko

@petersopko, what OS and command are you running?

I'm unable to reproduce this on my local. tested with pnpm generate and pnpm build maybe the error occurs on a specific OS only because build command works on main and successfully deployed

preschian avatar Jul 29 '22 06:07 preschian

just realized currently github actions only test pnpm build https://github.com/kodadot/nft-gallery/blob/main/.github/workflows/build.yml#L39 the correct one should be pnpm generate, I will open PR for that

should we test another OS also? github actions support windows and mac https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources

preschian avatar Jul 29 '22 06:07 preschian

@petersopko, what OS and command are you running?

I'm using Windows 11 Pro, 22000.795 build to be specific. Only time this worked without issues was when I spun up WSL with Ubuntu, however that's not a long term solution since it's slow af.

I'm unable to reproduce this on my local. tested with pnpm generate and pnpm build maybe the error occurs on a specific OS only because build command works on main and successfully deployed

I'm usually building app with nuxt dev, since scripts such as pnpm dev are causing other issues;

$ pnpm dev

> [email protected] dev D:\KodaDot\nft-gallery
> PORT=9090 nuxt dev

'PORT' is not recognized as an internal or external command,
operable program or batch file.
 ELIFECYCLE  Command failed with exit code 1.

Anyways, I've tried pnpm build which seems to only throw warnings, pnpm generate produces the same error for me. After some debugging yesterday, I've opened up https://github.com/paritytech/smoldot/issues/2564

petersopko avatar Jul 29 '22 06:07 petersopko

I'm using Windows 11 Pro, 22000.795 build to be specific. Only time this worked without issues was when I spun up WSL with Ubuntu, however that's not a long term solution since it's slow af.

I see, able to reproduce the error in GitHub actions with windows build. the error output same as you https://github.com/preschian/nft-gallery/runs/7574085756?check_suite_focus=true

I'm usually building app with nuxt dev, since scripts such as pnpm dev are causing other issues;

regarding ENV issue, we can use cross-env and change the script command. with that package should be ok running on cross OS

- "dev": "PORT=9090 nuxt dev",
+ "dev": "cross-env PORT=9090 nuxt dev",

Anyways, I've tried pnpm build which seems to only throw warnings, pnpm generate produces the same error for me. After some debugging yesterday, I've opened up https://github.com/paritytech/smoldot/issues/2564

cool 👍

preschian avatar Jul 29 '22 07:07 preschian

Wow nice!

vikiival avatar Jul 29 '22 09:07 vikiival

Builds now

yangwao avatar Aug 17 '22 12:08 yangwao