Git Product home page Git Product logo

Comments (9)

nklayman avatar nklayman commented on August 23, 2024 1

The issue was that the resolve extensions didn't contain '.js'. This is fixed and you can switch back to the beta with version 1.0.0-beta.6 when it comes out.

from vue-cli-plugin-electron-builder.

nklayman avatar nklayman commented on August 23, 2024 1

Beta.6 has just been released, you can use that now!

from vue-cli-plugin-electron-builder.

nklayman avatar nklayman commented on August 23, 2024 1

@beeing Try this:

// vue.config.js on the root of the project
module.exports = {
  chainWebpack: config => {
    config.resolve.extensions.add('.json')
  }
}

from vue-cli-plugin-electron-builder.

TotomInc avatar TotomInc commented on August 23, 2024

After some research, it looks like the issue come from the webpack configuration. I came across multiple SO/GitHub issues talking about editing resolve#extensions from webpack config.

This one for example, which is exactly the same error as I have.

EDIT: after tweaking the webpack config file and changing the orders of resolve extensions, it still doesn't work.

// vue.config.js on the root of the project
module.exports = {
  chainWebpack: config => {
    config.resolve.extensions
      .clear()
      .add('.ts')
      .add('.tsx')
      .add('.js')
      .add('.vue')
      .add('.json')
  }
}

EDIT 2: I have tried so much things but nothing is working:

  • Tweaking the webpack config with vue.config.js (passing config with configureWebpack or pluginOptions#electronBuilder) and following advices from here.
  • rm -rf ./node_modules and regen it with yarn (and repeat with npm).
  • Tweaking the tsconfig.json: jsx, module/target, baseUrl, include/exclude, moduleResolution, sourceMap.
  • vue inspect > vue.wp.js and checking the default config.
  • Manually inspect what's going on in node_modules/axios, but everything seems fine here.

At this point, I'm out of ideas and don't know what to do. This is very blocking for my project and I can't do anything.

EDIT 3: I tried to downgrade vcp-electron-builder to 0.3.2 and re-invoke it. Everything seems to work well so there is something definitely wrong with beta versions IMO. By default it generates an Electron main process file in .js, I switched it to a .ts.

Link to the branch of my repo with [email protected].

EDIT 4: It happened again while I was exporting 2 interfaces and a function from a file into an index.ts. It worked well until I added the 2 interfaces into the index.ts. The issue seems to be that it can't resolve indexes files that have more than 1 exported value. I have not tested a lot of things about it.

from vue-cli-plugin-electron-builder.

daprahamian avatar daprahamian commented on August 23, 2024

👍 Would love eyes on this

from vue-cli-plugin-electron-builder.

TotomInc avatar TotomInc commented on August 23, 2024

Thanks for the fix @nklayman, any ETA for the 1.0.0-beta.6?

from vue-cli-plugin-electron-builder.

nklayman avatar nklayman commented on August 23, 2024

It will be released within a few days. If you want to use it now, just set the version of vcp-electron-builder to nklayman/vue-cli-plugin-electron-builder to use the github repo instead of published version.

from vue-cli-plugin-electron-builder.

TotomInc avatar TotomInc commented on August 23, 2024

Works fine, it can now resolve .js index files from node_modules.

from vue-cli-plugin-electron-builder.

beeing avatar beeing commented on August 23, 2024

Hi, I'm experiencing similar issue but for .json file which from a npm module called spinnies. Is there any workaround for this?

Thanks in advance.

from vue-cli-plugin-electron-builder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.