question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong url for safari-nomodule-fix if publicPath is absolute url (V5)

See original GitHub issue

Version

5.0.0-beta.2

Environment info

  System:
    OS: macOS 10.15.7
    CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
  Binaries:
    Node: 12.16.3 - /usr/local/bin/node
    Yarn: 1.17.3 - ~/.npm-global/bin/yarn
    npm: 6.14.8 - ~/.npm-global/bin/npm
  Browsers:
    Chrome: 92.0.4515.93
    Edge: Not Found
    Firefox: 90.0
    Safari: 14.1
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1 
    @vue/babel-helper-vue-transform-on:  1.0.2 
    @vue/babel-plugin-jsx:  1.0.6 
    @vue/babel-plugin-transform-vue-jsx:  1.2.1 
    @vue/babel-preset-app:  5.0.0-beta.2 
    @vue/babel-preset-jsx:  1.2.4 
    @vue/babel-sugar-composition-api-inject-h:  1.2.1 
    @vue/babel-sugar-composition-api-render-instance:  1.2.4 
    @vue/babel-sugar-functional-vue:  1.2.2 
    @vue/babel-sugar-inject-h:  1.2.2 
    @vue/babel-sugar-v-model:  1.2.3 
    @vue/babel-sugar-v-on:  1.2.3 
    @vue/cli-overlay:  5.0.0-beta.2 
    @vue/cli-plugin-babel: ~5.0.0-beta.2 => 5.0.0-beta.2 
    @vue/cli-plugin-eslint: ^5.0.0-beta.2 => 5.0.0-beta.2 
    @vue/cli-plugin-router: ^5.0.0-beta.2 => 5.0.0-beta.2 
    @vue/cli-plugin-vuex: ^5.0.0-beta.2 => 5.0.0-beta.2 
    @vue/cli-service: ~5.0.0-beta.2 => 5.0.0-beta.2 
    @vue/cli-shared-utils:  5.0.0-beta.2 
    @vue/compiler-core:  3.1.5 
    @vue/compiler-dom:  3.1.5 
    @vue/compiler-sfc:  3.1.5 
    @vue/compiler-ssr:  3.1.5 
    @vue/component-compiler-utils:  3.2.2 
    @vue/eslint-config-prettier: ^6.0.0 => 6.0.0 
    @vue/shared:  3.1.5 
    @vue/web-component-wrapper:  1.3.0 
    eslint-plugin-vue: ^7.14.0 => 7.14.0 
    vue: ^2.6.11 => 2.6.14 
    vue-cli-plugin-style-resources-loader: ~0.1.5 => 0.1.5 
    vue-eslint-parser:  7.9.0 
    vue-gettext: ^2.1.12 => 2.1.12 
    vue-hot-reload-api:  2.3.4 
    vue-loader:  16.3.1 (15.9.7)
    vue-router: ^3.2.0 => 3.5.2 
    vue-style-loader:  4.1.3 
    vue-template-compiler: ^2.6.14 => 2.6.14 
    vue-template-es2015-compiler:  1.9.1 
    vuex: ^3.4.0 => 3.6.2 
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

publicPath:
    process.env.NODE_ENV === 'production'
      ? 'http://localhost:8000/static/frontend'
      : '/static/frontend',

What is expected?

Script publicPath is the same and is correct

<script src="http://localhost:8000/static/frontend/js/safari-nomodule-fix.js" type="module"></script>

What is actually happening?

Script publicPath is wrong, 2nd slash after http is omitted

<script src="http:/localhost:8000/static/frontend/js/safari-nomodule-fix.js" type="module"></script>

Why? How to pass absolute url for production? (I have all static files hosted on CDN on another domain)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

15reactions
RekingZhangcommented, Apr 19, 2022
 configureWebpack: (config) => {
        const SafariNomoduleFixPlugin = config.plugins.find(
            (plugin) => plugin?.constructor?.name === 'SafariNomoduleFixPlugin'
        );
        if (SafariNomoduleFixPlugin) {
            SafariNomoduleFixPlugin.unsafeInline = true;
        }
}
0reactions
yilihjycommented, Jul 22, 2022

In my project, I use https://github.com/vuejs/vue-cli/pull/7247 to solve this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[v1.1.8] publicPath does not work with protocol/absolute URLs
it is not possible and the // characters are getting replaced with one / rendering the absolute URL invalid... Is there another way...
Read more >
Public Path - webpack
It allows you to specify the base path for all the assets within your application. Use Cases. There are a few use cases...
Read more >
Webpack5 Automatic publicPath is not supported in this browser
It is triggered when a stylesheet references a resource using url(...) and the publicPath option is not set explicitly in the Webpack ...
Read more >
Webpack — Understanding the 'publicPath' mystery - Medium
So, here I am going to unfold the mystery of publicPath config ... to be an absolute and not relative else webpack will...
Read more >
@vue/cli-plugin-e2e-cypress | Yarn - Package Manager
vuejs431kMIT5.0.8. e2e-cypress plugin for vue-cli ... Display full readme Display full readme. changelog. 5.0.7 (2022-07-05). @vue/cli-service.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found