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

Invalid asm.js: Unexpected token - yoga-layout-prebuilt #898

Closed
hutch120 opened this issue May 31, 2019 · 18 comments
Closed

Invalid asm.js: Unexpected token - yoga-layout-prebuilt #898

hutch120 opened this issue May 31, 2019 · 18 comments

Comments

@hutch120
Copy link

Report

  • [x ] I have searched for the error message in existing issues and this is not a duplicate

There are a bunch of people over on react-pdf that are seeing this issue.

Issues and Steps to Reproduce

Very first message In the console when running a create-react-app with the react-pdf code using npm start there is a cryptic message in the Chrome console log (during the react import/build process?)

Invalid asm.js: Unexpected token .../app/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:5503

My environment is pretty much a vanilla create react app.

Tracked it down to the import statement:
import { PDFViewer, Document, Page, Text, View, StyleSheet } from '@react-pdf/renderer'

Expected Behavior

No warning from yoga-layout in the console.

Actual Behavior

Console message. Generates the PDF just fine.

Link to Code

Sorry, I tried to reproduce in https://codesandbox.io but it fails to import the PDF library.
It can be setup pretty easily with vanilla create-react-app and add the code in the readme at https://github.com/diegomura/react-pdf

Environment

OS: Windows
Browser chrome
React-pdf version 1.5.6

@dimosmera
Copy link

Here from react-pdf. We are getting this issue as well.
Would be great to see it resolved.

@leonardfactory
Copy link

Not a clean error, but I found that printing text inside a View component instead of a Text component triggered this error.

@AlistairNilsen
Copy link

In my scenario the error was the variable "ib" used everywhere in nbind.js
It was created as const and is used to set the initial value of many other variables.
In my first fix I just replaced "ib;" and "ib," by the initial ib value: T(0) -> "T(0);" and "T(0)," respectively, to set the initial value directly on each variable.

@gabrieledarrigo
Copy link

Ciao guys,
I'm here too from react-pdf.
Any news on how to fix this warning?
In our case, we are getting the error while running our tests suite with Jest.

@MirKml
Copy link

MirKml commented Jul 24, 2020

Any news on how to fix this warning?
In our case, we are getting the error while running our tests suite with Jest.

Same for us - when some components which uses reac-pdf and yoga-layout as its dependency is used in jest this error is printed out

@lucasob
Copy link

lucasob commented Aug 10, 2020

Jumping in as well from react-pdf using Jest specifically; would be incredible to have this fixed

@milesj
Copy link

milesj commented Nov 29, 2020

Bumping this.

@AustinAmoruso
Copy link

Same here. React-PDF. Seeing this issue too.

Invalid asm.js: Unexpected token

@windmaomao
Copy link

Bumping this. At least what does it mean?

@MadcowD
Copy link

MadcowD commented Apr 22, 2021

Bump!

@aravzpatel
Copy link

BumpetyBump?

@AustinAmoruso
Copy link

Bump

@oktalk
Copy link

oktalk commented Nov 12, 2021

Experiencing this issue as well. This issue as actually breaking my pre-render.

@Faithfinder
Copy link

Saaame

@cduff
Copy link

cduff commented Nov 30, 2021

I just found this after creating an issue against react-pdf for creating errors in Jest output: diegomura/react-pdf#1627

For that issue I created a minimal reproduction repo: https://github.com/cduff/react-pdf-linking-failure

@beldougie
Copy link

Bumpity Bump Bump Bump :)

10 months on since the last comment on this issue, also here from @react-pdf/renderer and this is still an issue in my jest output. React 16, @react-pdf/render v2.3.0 Would love to see this go away ...

@ghost
Copy link

ghost commented Aug 31, 2022

I'm also seeing this in my jest tests

@NickGerleman
Copy link
Contributor

It looks like this is an issue with the built output of yoga-layout-prebuilt, which we do not directly support. This issue should belong on their repo.

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