Skip to content

CDN webpackJsonp function conflicts with existing webpackJsonp function #42

@aputinski

Description

@aputinski

[REQUIRED] Describe your environment

  • Operating System version: macOS 10.12
  • Firebase SDK version: 4.1.1 (CDN)
  • Firebase Product: all

[REQUIRED] Describe the problem

Steps to reproduce:

It appears that the client is bundled via webpack and uses the CommonsChunkPlugin. My code is also bundled via webpack uses the same plugin. As a result my code defines webpackJsonp on the window and then later when I load Firebase from the CDN it tries to use my webpackJsonp function which won't work because they are different bundles.

<!-- My Wepback bundles -->
<script src="/assets/bundle/common.js"></script>
<script src="/assets/bundle/app.js"></script>
<!-- Firebase -->
<!-- (throws an error) -->
<script src="https://www.gstatic.com/firebasejs/4.1.1/firebase.js"></script>

Firebase should change the name of the jsonp function used to something like webpackJsonpFirebase to avoid conflicts.

https://webpack.js.org/configuration/output/#output-jsonpfunction

This needs to be changed if multiple webpack runtimes (from different compilation) are used on the same webpage.

Relevant Code:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions