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

Expected 'styles' to be an array of strings. #118

Closed
jroweboy opened this issue Sep 21, 2016 · 2 comments
Closed

Expected 'styles' to be an array of strings. #118

jroweboy opened this issue Sep 21, 2016 · 2 comments

Comments

@jroweboy
Copy link

jroweboy commented Sep 21, 2016

I've been following the latest README to try to make a local change to ReDoc, but I've been running into several issues along the way. If it helps to know, I'm developing on Windows, (but I don't think thats the issue). When I run npm start the server boots as expected, but when the page starts loading, it ends up failing to render with this as the error http://i.imgur.com/JCpO1xF.png The full stack trace from the error is below.

zone.js:355 Unhandled Promise rejection: Expected 'styles' to be an array of strings. ; Zone: <root> ; Task: Promise.then ; Value: Error: Expected 'styles' to be an array of strings.(…) Error: Expected 'styles' to be an array of strings.
    at assertArrayOfStrings (http://localhost:9000/vendor.js:23760:19)
    at CompileMetadataResolver.getDirectiveMetadata (http://localhost:9000/vendor.js:15892:113)
    at http://localhost:9000/vendor.js:16035:49
    at Array.forEach (native)
    at CompileMetadataResolver.getNgModuleMetadata (http://localhost:9000/vendor.js:16029:49)
    at RuntimeCompiler._compileComponents (http://localhost:9000/vendor.js:26183:47)
    at RuntimeCompiler._compileModuleAndComponents (http://localhost:9000/vendor.js:26121:37)
    at RuntimeCompiler.compileModuleAsync (http://localhost:9000/vendor.js:26112:21)
    at PlatformRef_._bootstrapModuleWithZone (http://localhost:9000/vendor.js:18449:25)
    at PlatformRef_.bootstrapModule (http://localhost:9000/vendor.js:18431:21)
    at Object.bootstrapRedoc (http://localhost:9000/redoc.js:13502:64)
    at http://localhost:9000/redoc.js:13368:28
    at ZoneDelegate.invoke (http://localhost:9000/polyfills.js:16418:28)
    at Zone.run (http://localhost:9000/polyfills.js:16311:43)
    at http://localhost:9000/polyfills.js:16677:57
    at ZoneDelegate.invokeTask (http://localhost:9000/polyfills.js:16451:37)
    at Zone.runTask (http://localhost:9000/polyfills.js:16351:47)
    at drainMicroTaskQueue (http://localhost:9000/polyfills.js:16583:35)

I tried to do a little digging, and found that the component its trying to render is ApiInfo. Sure enough, when it verifies that the styles are an array, it finds that the styles are an array of Objects and fails. I have no idea why its contains an Object instead of the string though. I poked around api-info.ts but I couldn't figure out what the real issue is.

Edit: To be clear, I've been googling this error, and the common response seems to be "make sure styles is an array of strings." which is what I tried to check. I couldn't seem to figure out why its not an array of strings though. It looks like it compiles the css output from sass into an importable string in the css.shim.ts file, but thats as far as I got.

@RomanHotsiy
Copy link
Member

Fixed via 79693e1

@RomanHotsiy
Copy link
Member

@jroweboy thanks by reporting

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

No branches or pull requests

2 participants