-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
circular dependency between util.js and config.js #6023
Comments
As a follow-up, we got this working by setting Looks like the mix of module formats in prebid.js was causing issues for us. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'm also experiencing this issue. We have a React app, so we're using a Webpack dynamic import to pull in the Prebid NPM package and all of the adapter modules that we need (because Prebid requires access to the We started with Is there a fix planned for version Unfortunately, we're unable to change our Webpack configuration, so we can't apply the |
@markplewis are you still working around this issue? I can do a bit more research on this and see what solutions may be possible. |
If I'm correct concatenateModules in webpack only is True when webpack is set to in production and has to do with figuring out which exports are used versus unused and prioritizing import. I have a next app setup in a similar configuration but I don't seem to be encountering this so can't provide too much guidance at a more technical level. My Webpack is definitely much more simple. I think this brings up webpack dead code elimination because that is the main reason for this production prioritization but we are not utilizing the used vs unused distinctions. |
Sorry @ChrisHuie, I didn't notice your reply until now. We downgraded to version |
Type of issue
Possible bug - although since nobody else has complained about this, there must be a workaround
Description
We have been running Prebid without problems up to version 3.15.0. When we upgraded to 3.16.0 (and any version after), running it on a site results in the following error:
TypeError: p.getParameterByName is not a function
I've narrowed it down to the change here introduced in 3.16.0 #5092
and in particular changing this in config.js
const DEFAULT_DEBUG = (parseQS(window.location.search)[CONSTANTS.DEBUG_MODE] || '').toUpperCase() === 'TRUE';
to this
const DEFAULT_DEBUG = utils.getParameterByName(CONSTANTS.DEBUG_MODE).toUpperCase() === 'TRUE';
config.js imports utils.js
const utils = require('./utils.js');
but utils.js also imports config.jsimport { config } from './config.js';
If I comment out the import inside utils.js, everything loads fine. If I add the line back in, the error appears.
This circular dependency is causing issues because the DEFAULT_DEBUG is now calling the
utils.getParameterByName
immediately, bututils
hasn't finished loading yet sogetParameterByName
is not available.I have not seen anyone else mention this specific error so is there some setting in webpack or babel etc that allows this to work
for others?
We're using prebid with
import prebid from 'prebid.js';
, as soon as this import is included, the error appears.Steps to reproduce
Upgrade from Prebid 3.15.0 to 3.16.0
We did not change anything else in our implementation
Test page
N/A
Expected results
Prebid loads as usual on sites
Actual results
This error appears breaking all the ads
TypeError: p.getParameterByName is not a function
Platform details
Prebid.js version 3.16.0 and up (have tried with latest 4.17.0)
Chrome 86
Node 10 (have tried v12 as well)
Webpack 4.35
Babel 7
Other information
This is the PR change which seems to have introduced the issue #5092
The text was updated successfully, but these errors were encountered: