Skip to content
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

Client Bundle Webpack Error #344

Open
glenatmake opened this issue Oct 7, 2020 · 1 comment
Open

Client Bundle Webpack Error #344

glenatmake opened this issue Oct 7, 2020 · 1 comment

Comments

@glenatmake
Copy link

longclaw version: 1.0.2
Django version: 3.1
Python version: 3.8.3

I'm trying to load the javascript libraries using the longclaw template tags into the supplied product template (catalog/template/catalog/product.html):

{% load static core_tags wagtailimages_tags longclawcore_tags %}

... HTML ...

{% longclaw_vendors_bundle %}
{% longclaw_client_bundle %}

When loading the page I get an error from longclawclient.bundle.js:

Uncaught ReferenceError: webpackJsonp is not defined at longclawclient.bundle.js:1

The vendors bundle is loading correctly before the client bundle, the files are loaded from the virtaulenv:
{project}/lib/python3.8/site-packages/longclaw/static/core/js/vendors.bundle.js
{project}/lib/python3.8/site-packages/longclaw/static/core/js/longclawclient.bundle.js

The project is was scaffolded with the longclaw CLI.

@akshayaureatelabs
Copy link

longclaw version: 1.0.2 Django version: 3.1 Python version: 3.8.3

I'm trying to load the javascript libraries using the longclaw template tags into the supplied product template (catalog/template/catalog/product.html):

{% load static core_tags wagtailimages_tags longclawcore_tags %}

... HTML ...

{% longclaw_vendors_bundle %}
{% longclaw_client_bundle %}

When loading the page I get an error from longclawclient.bundle.js:

Uncaught ReferenceError: webpackJsonp is not defined at longclawclient.bundle.js:1

The vendors bundle is loading correctly before the client bundle, the files are loaded from the virtaulenv: {project}/lib/python3.8/site-packages/longclaw/static/core/js/vendors.bundle.js {project}/lib/python3.8/site-packages/longclaw/static/core/js/longclawclient.bundle.js

The project is was scaffolded with the longclaw CLI.

@glenatmake @janbaykara Hello,
It seems that the error you are encountering is related to the Webpack runtime not being able to find the global webpackJsonp function, which is usually defined in the vendors.bundle.js file.

Here are some steps you can take to try to resolve the issue:

  1. Make sure that you have installed all the required dependencies for your project, especially those related to Webpack and its plugins.

  2. Check that the vendors.bundle.js file is being loaded correctly and that it defines the webpackJsonp function. You can do this by opening the file in a text editor or using the browser's developer tools to inspect the loaded script.

  3. Verify that the longclawclient.bundle.js file is being loaded after the vendors.bundle.js file. You can do this by inspecting the network requests in your browser's developer tools.

  4. If the above steps do not resolve the issue, you can try rebuilding the bundles using Webpack. You can do this by running the npm run build command in your project's root directory. This will rebuild the client and vendor bundles and place them in the static/ directory.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants