Codesandbox-client: Cannot read property 'toString' of undefined

Created on 4 Jun 2018  ·  7Comments  ·  Source: codesandbox/codesandbox-client

🐛 bug report

Description of the problem

Quite a simple project, get the following error:

TypeError: Cannot read property 'toString' of undefined
    at new e (https://codesandbox.io/static/js/vue-style-compiler.0c62f804.chunk.js:1:51429)
    at t.default (https://codesandbox.io/static/js/vue-style-compiler.0c62f804.chunk.js:1:67030)
    at new e (https://codesandbox.io/static/js/vue-style-compiler.0c62f804.chunk.js:1:54000)
    at e.process (https://codesandbox.io/static/js/vue-style-compiler.0c62f804.chunk.js:1:80236)
    at https://codesandbox.io/static/js/vue-style-compiler.0c62f804.chunk.js:1:125475
    at new Promise (<anonymous>)
    at new t (https://codesandbox.io/static/js/common-sandbox.405431f9.js:21:97647)
    at Object.t.default (https://codesandbox.io/static/js/vue-style-compiler.0c62f804.chunk.js:1:125200)
    at https://codesandbox.io/static/js/sandbox.7b01ecfb.js:259:353017

This is the same sandbox as #881 but ported to a Vue CLI 2 project.

The CS UI shows core/ui/UiButton.vue as being the problem file:

image

The import chain (I'm globally registering the UI components from main.js) is:

main.js
core/ui/index.js
core/ui/UiButton.js

Not sure if this is some kind of project config issue or not. Sorry!

Link to sandbox: link

Your Environment

| Software | Name/Version|
| ---------------- | ---------- |
| Сodesandbox | Online
| Browser | Chrome 66
| Operating System | OSX 10.12.6

Most helpful comment

Ooh I think I know what it is. Stupid mistake on my side. It seems like our
bundler has problems with empty style tags, as soon as you add something in
the tag it should work.

On Mon, Jun 4, 2018, 14:39 Dave Stewart notifications@github.com wrote:

🐛 bug report Description of the problem

Quite a simple project, get the following error:

TypeError: Cannot read property 'toString' of undefined
at new e (https://codesandbox.io/static/js/vue-style-compiler.0c62f804.chunk.js:1:51429)
at t.default (https://codesandbox.io/static/js/vue-style-compiler.0c62f804.chunk.js:1:67030)
at new e (https://codesandbox.io/static/js/vue-style-compiler.0c62f804.chunk.js:1:54000)
at e.process (https://codesandbox.io/static/js/vue-style-compiler.0c62f804.chunk.js:1:80236)
at https://codesandbox.io/static/js/vue-style-compiler.0c62f804.chunk.js:1:125475
at new Promise ()
at new t (https://codesandbox.io/static/js/common-sandbox.405431f9.js:21:97647)
at Object.t.default (https://codesandbox.io/static/js/vue-style-compiler.0c62f804.chunk.js:1:125200)
at https://codesandbox.io/static/js/sandbox.7b01ecfb.js:259:353017

This is the same sandbox as #881
https://github.com/CompuIves/codesandbox-client/issues/881 but ported
to a Vue CLI 2 project.

The CS UI shows core/ui/UiButton.vue as being the problem file:

[image: image]
https://user-images.githubusercontent.com/132681/40917724-1e7b0c70-67fc-11e8-8d47-33548a4ea7f2.png

The import chain (I'm globally registering the UI components from main.js)
is:

main.js
core/ui/index.js
core/ui/UiButton.js

Not sure if this is some kind of project config issue or not. Sorry!
Link to sandbox: link https://codesandbox.io/s/20qvvlmkmj Your
Environment
Software Name/Version
Сodesandbox Onlnie
Browser Chrome 66
Operating System OSX 10.12.6


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/CompuIves/codesandbox-client/issues/882, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AAj1CA3Rs0KRhs8RYpLwLF9724q4UB7Nks5t5SpkgaJpZM4UZAlM
.

All 7 comments

Ooh I think I know what it is. Stupid mistake on my side. It seems like our
bundler has problems with empty style tags, as soon as you add something in
the tag it should work.

On Mon, Jun 4, 2018, 14:39 Dave Stewart notifications@github.com wrote:

🐛 bug report Description of the problem

Quite a simple project, get the following error:

TypeError: Cannot read property 'toString' of undefined
at new e (https://codesandbox.io/static/js/vue-style-compiler.0c62f804.chunk.js:1:51429)
at t.default (https://codesandbox.io/static/js/vue-style-compiler.0c62f804.chunk.js:1:67030)
at new e (https://codesandbox.io/static/js/vue-style-compiler.0c62f804.chunk.js:1:54000)
at e.process (https://codesandbox.io/static/js/vue-style-compiler.0c62f804.chunk.js:1:80236)
at https://codesandbox.io/static/js/vue-style-compiler.0c62f804.chunk.js:1:125475
at new Promise ()
at new t (https://codesandbox.io/static/js/common-sandbox.405431f9.js:21:97647)
at Object.t.default (https://codesandbox.io/static/js/vue-style-compiler.0c62f804.chunk.js:1:125200)
at https://codesandbox.io/static/js/sandbox.7b01ecfb.js:259:353017

This is the same sandbox as #881
https://github.com/CompuIves/codesandbox-client/issues/881 but ported
to a Vue CLI 2 project.

The CS UI shows core/ui/UiButton.vue as being the problem file:

[image: image]
https://user-images.githubusercontent.com/132681/40917724-1e7b0c70-67fc-11e8-8d47-33548a4ea7f2.png

The import chain (I'm globally registering the UI components from main.js)
is:

main.js
core/ui/index.js
core/ui/UiButton.js

Not sure if this is some kind of project config issue or not. Sorry!
Link to sandbox: link https://codesandbox.io/s/20qvvlmkmj Your
Environment
Software Name/Version
Сodesandbox Onlnie
Browser Chrome 66
Operating System OSX 10.12.6


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/CompuIves/codesandbox-client/issues/882, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AAj1CA3Rs0KRhs8RYpLwLF9724q4UB7Nks5t5SpkgaJpZM4UZAlM
.

I decided to just remove the empty style tags, and FYI the error does not always show in the component that is the cause of the error.

In my case:

  • if A, B and C had empty style tags
  • and are imported in that order

Fixing A (removing the style tag) will still show an error in A
Fixing B will then remove the error for A, but show the error in B
Fixing C will then remove the error for B, and C

Might be useful to you at some point

Actually, removing all the style tags has not fixed it:

New error:

TypeError: Cannot read property 'content' of undefined
    at Object.a.default (https://codesandbox.io/static/js/vue-selector.f5bc3080.chunk.js:1:665)
    at https://codesandbox.io/static/js/sandbox.7b01ecfb.js:259:353358

Hmm, in the last mentioned sandbox you still have style tags in QueryList.vue I believe. I'm fixing the issue now nevertheless 😄

@CompuIves Hi... this bug hasn't fixed. I can only be added some tag that has some syntax in the Style tag.

@yancymin Can you please share a link to the sandbox you have issues with?

@lbogdan it's going be OK while I had added some syntax in the style.

Was this page helpful?
0 / 5 - 0 ratings