FredKSchott / create-snowpack-app

The all-in-one app template for Snowpack. [moved]
https://www.snowpack.dev
Other
727 stars 96 forks source link

Error bundling React app using webpack plugin #148

Closed haikyuu closed 4 years ago

haikyuu commented 4 years ago

Here is my config file:

module.exports = {
  "extends": "@snowpack/app-scripts-react",
  "scripts": {
    "bundle:*": "@snowpack/plugin-webpack"
  },
  "plugins": [
    [
      "@snowpack/plugin-webpack",
      {
        "sourceMap": true,
        extendConfig: (config) => {
          // config.plugins.push(/* ... */);
          return config;
        },
      }
    ]
  ],
  "proxy": {
    "/api": "http://127.0.0.1:4000"
  }
}

And here is the output of running the build command:

Snowpack

  ./build Building your application...

  mount:web_modules.......[DONE] mount $WEB_MODULES --to /web_modules
  mount:public............[DONE] mount public --to /
  mount:src...............[DONE] mount src --to /_dist_
  build:js,jsx,ts,tsx.....[DONE] (plugin) @snowpack/plugin-babel
  bundle:*................[FAIL] (plugin) @snowpack/plugin-webpack

▼ bundle:*

  TypeError: Cannot read property 'baseUrl' of undefined

▼ Result

  ⚠️  Finished, with errors.

 ERROR  Command failed with exit code 1.
haikyuu commented 4 years ago

After attaching a debugger, i found where the issue is coming from:

image

I guess this was fixed by this PR #144

When can we expect a release? or was it already released to npm?

FredKSchott commented 4 years ago

config.buildOptions should always be an object in the latest version of Snowpack, so updating Snowpack should solve this today. If not, I'll make sure that we merge this by End of Day today. Thanks for the reminder!