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

Traceback: Don't use path.replaceWith() with a source string #812

Closed
mythmon opened this issue Jun 13, 2017 · 2 comments
Closed

Traceback: Don't use path.replaceWith() with a source string #812

mythmon opened this issue Jun 13, 2017 · 2 comments
Assignees
Labels
Defect Something isn't as it should be

Comments

@mythmon
Copy link
Contributor

mythmon commented Jun 13, 2017

This has come up in CI. @Osmose said that path.replaceWith() is a Babel thing. I bet this has something to do with unpinned Node dependencies, and possibly Babili.

Traceback:

webpack_loader.exceptions.WebpackError:              Error in              unknown: Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`
self = <test_views.TestSelfRepair object at 0x7fb69d6e6a58>
client = <django.test.client.Client object at 0x7fb69d6ef908>

    @pytest.mark.django_db
    def test_doesnt_redirect(self, client):
>       assert client.get(self.url).status_code == 200

normandy/selfrepair/tests/test_views.py:28: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.6/site-packages/django/test/client.py:529: in get
    **extra)
/usr/local/lib/python3.6/site-packages/django/test/client.py:333: in get
    return self.generic('GET', path, secure=secure, **r)
/usr/local/lib/python3.6/site-packages/django/test/client.py:409: in generic
    return self.request(**r)
/usr/local/lib/python3.6/site-packages/django/test/client.py:494: in request
    six.reraise(*exc_info)
/usr/local/lib/python3.6/site-packages/django/utils/six.py:686: in reraise
    raise value
/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py:42: in inner
    response = get_response(request)
/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py:187: in _get_response
    response = self.process_exception_by_middleware(e, request)
/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py:185: in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
normandy/base/decorators.py:17: in wrapped_view
    return view_func(*args, **kwargs)
/usr/local/lib/python3.6/site-packages/django/views/decorators/cache.py:43: in _cache_controlled
    response = viewfunc(request, *args, **kw)
normandy/selfrepair/views.py:19: in repair
    'classify_client_url': classify_client_url,
/usr/local/lib/python3.6/site-packages/django/shortcuts.py:30: in render
    content = loader.render_to_string(template_name, context, request, using=using)
/usr/local/lib/python3.6/site-packages/django/template/loader.py:68: in render_to_string
    return template.render(context, request)
/usr/local/lib/python3.6/site-packages/django/template/backends/django.py:66: in render
    return self.template.render(context)
/usr/local/lib/python3.6/site-packages/django/template/base.py:208: in render
    return self._render(context)
/usr/local/lib/python3.6/site-packages/django/test/utils.py:94: in instrumented_test_render
    return self.nodelist.render(context)
/usr/local/lib/python3.6/site-packages/django/template/base.py:994: in render
    bit = node.render_annotated(context)
/usr/local/lib/python3.6/site-packages/django/template/base.py:961: in render_annotated
    return self.render(context)
/usr/local/lib/python3.6/site-packages/django/template/library.py:203: in render
    output = self.func(*resolved_args, **resolved_kwargs)
normandy/base/templatetags/normandy_webpack_loader.py:19: in render_bundle
    chunks = get_files(bundle_name, extension=extension, config=config)
/usr/local/lib/python3.6/site-packages/webpack_loader/templatetags/webpack_loader.py:67: in get_files
    return list(_get_bundle(bundle_name, extension, config))
/usr/local/lib/python3.6/site-packages/webpack_loader/templatetags/webpack_loader.py:32: in _get_bundle
    bundle = get_loader(config).get_bundle(bundle_name)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <webpack_loader.loader.WebpackLoader object at 0x7fb69e0c6e10>
bundle_name = 'selfrepair'

    def get_bundle(self, bundle_name):
        assets = self.get_assets()
    
        if settings.DEBUG:
            # poll when debugging and block request until bundle is compiled
            # TODO: support timeouts
            while assets['status'] == 'compiling':
                time.sleep(self.config['POLL_INTERVAL'])
                assets = self.get_assets()
    
        if assets.get('status') == 'done':
            chunks = assets['chunks'][bundle_name]
            return self.filter_chunks(chunks)
    
        elif assets.get('status') == 'error':
            if 'file' not in assets:
                assets['file'] = ''
            error = u"""
                {error} in {file}
                {message}
                """.format(**assets)
>           raise WebpackError(error)
E           webpack_loader.exceptions.WebpackError: 
E                       Error in 
E                       unknown: Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`

/usr/local/lib/python3.6/site-packages/webpack_loader/loader.py:74: WebpackError
@mythmon mythmon added the Defect Something isn't as it should be label Jun 13, 2017
@Osmose
Copy link
Contributor

Osmose commented Jun 14, 2017

Babili's got a bug on file for this: babel/minify#576

@Osmose Osmose self-assigned this Jun 14, 2017
Osmose pushed a commit to Osmose/normandy that referenced this issue Jun 14, 2017
@Osmose
Copy link
Contributor

Osmose commented Jun 14, 2017

Locally I'm actually getting a different set of errors that seem to be related to babel/minify#577.

I put up #813, which fixed my local issues, in an attempt to see if it also fixes these issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Something isn't as it should be
Projects
None yet
Development

No branches or pull requests

2 participants