Git Product home page Git Product logo

Comments (9)

oliviertassinari avatar oliviertassinari commented on June 15, 2024

I'm wondering if that change could help. I see that it's using the ES5 syntax.

- serviceWorkerPlugin = require('serviceworker-webpack-plugin')
+ serviceWorkerPlugin = require('serviceworker-webpack-plugin').default

from serviceworker-webpack-plugin.

glittle avatar glittle commented on June 15, 2024

Thanks, Olivier.

new serviceWorkerPlugin({
^
TypeError: serviceWorkerPlugin is not a constructor

With the .default added, I get the above error. And removing the new doesn't help, of course.

In reviewing what I'm doing, what I really want is simply the ability to specify a file that will be served from the root of the website beside the 'index.js', both in the dev environment and when the build is run. Do you have any suggestions on how I can do that? It seems that this is a webpack configuration exercise, but I haven't found how to do it.

from serviceworker-webpack-plugin.

oliviertassinari avatar oliviertassinari commented on June 15, 2024

My bad, we already have the add-module-exports babel plugin. No need for that .default.

from serviceworker-webpack-plugin.

oliviertassinari avatar oliviertassinari commented on June 15, 2024

I'm gonna close that issue. Sorry, I don't have time to investigate.

from serviceworker-webpack-plugin.

rstoenescu avatar rstoenescu commented on June 15, 2024

Hi,

I think best would be to at least leave it open for when you'll have time for it. I know how time can be an issue in itself, but this does needs a fix.

Great work with the plugin btw.

from serviceworker-webpack-plugin.

glittle avatar glittle commented on June 15, 2024

I've changed my approach so that I no longer need this plugin... so you don't need to hold it open on my behalf.

from serviceworker-webpack-plugin.

oliviertassinari avatar oliviertassinari commented on June 15, 2024

Actually, it could be linked to an issue with webpack@2. I'm looking into that.

from serviceworker-webpack-plugin.

oliviertassinari avatar oliviertassinari commented on June 15, 2024

Wrong assumption, it's working fine with it: #17.

from serviceworker-webpack-plugin.

oliviertassinari avatar oliviertassinari commented on June 15, 2024

I have figured our the issue using glittle/badi-web3@2201697.
Actually, there are two issues right here.

1. Wrong parameter

@glittle The path you are providing doesn't match with a file on the system...

-entry: path.join(__dirname, 'special/sw-badi-web3.js'),
+entry: path.join(__dirname, '../special/sw-badi-web3.js')

2. Error swallowed

@rstoenescu as the path argument provided is invalid, the ServiceWorkerPlugin plugin crash and throw an exception. However, that error is never showed. That's most likely due to the custom logic implemented inside build/script.dev.js. I suggest you having a look at the https://github.com/webpack/webpack-dev-server implementation. That could help.

from serviceworker-webpack-plugin.

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.