Lunie: Extension hot reload failing: FILE NOT FOUND

Created on 24 Aug 2020  路  13Comments  路  Source: luniehq/lunie

Probably just some silly webpack bug:

image

Steps to reproduce:

  • build extension locally
  • run yarn watch:dev
  • make some change in the code and try to open extension again

You will get the above blank screen with the FILE NOT FOUND error.

To fix it you need to rerun yarn watch:dev

bug

All 13 comments

I'm investigating this and seems related to staging-API being down... but I am not sure (cannot obviously confirm as staging API is dead)

Ah ok, the problem is that after rebuilding when hot reloading it loses the manifest.json. Investigating

      {
        from: 'manifest.json',
        to: 'manifest.json',
        transform: (content) => {
          const jsonContent = JSON.parse(content)
          jsonContent.version = version

          if (config.mode === 'development') {
            jsonContent['content_security_policy'] =
              "script-src 'self' 'unsafe-eval' https://www.google-analytics.com/analytics.js; object-src 'self'"
          }

          return JSON.stringify(jsonContent, null, 2)
        }
      }

manifest.json gets renames as manifest.js :thinking: We are missing some rule here?

@mariopino could you reproduce this?

@mariopino could you reproduce this?

Yep, I'll try to reproduce today

:eyes:

image

Did you make any progress here? Should I take this?

Mmm, trying various things but nothing seems to work. manifest.json always disappears for some reason

It seems like there was already some trouble with this in any case. This chunk of code is to be found in webpack.config.js:

if (process.env.HMR === 'true') {
  config.plugins = (config.plugins || []).concat([
    new ExtensionReloader({
      manifest: resolve('src/manifest.json')
    })
  ])
}

@mariopino could you reproduce this?

Yep, I'll try to reproduce today

Sorry to be late but yep, it can be reproduced in Windows 10 / Chrome:

image

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

This got staled and it is a very annoying bug for development. Someone has any idea?

well, there is something going on with webpack-extension-reloader and HMR.

webpack-extension-reloader doesn't work with HMR:
Screen Shot 2020-10-14 at 8 15 10 AM

the docs recommend using __dirname but we are using a static folder.

... not sure!

@faboweb any ideas?

Mmm, interesting :thinking: Maybe we should rename dist as __dirname?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JakeHartnell picture JakeHartnell  路  3Comments

jbibla picture jbibla  路  3Comments

nylira picture nylira  路  3Comments

fedekunze picture fedekunze  路  3Comments

jbibla picture jbibla  路  4Comments