You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a FlexGridPdfConverter class in our library (Wijmo). When we use the draw() method to draw the FlexGrid into a PdfDocument it produces an error in the constole: “Uncaught ** Assertion failed in Wijmo: Invalid argument: "value". Error”.
The error is caused because of failure of following check: “e instanceof PdfPen”
The reason is that the “e” variable contains the instance of “PdfPen” instead of “PdfPen2”.
You may observe the same in the images below:
Please note that I tried to run the exact code in an esbuild setup, and the issue does not occur. In esbuild setup also, the names are modifed by appending the suitable number in front of classes.
1 Extract the sample: instanceof check issue.zip
2. Run “npm i -f” and “npm run dev” to install the dependencies and run the sample.
3. Click on the “Export” button.
4. Observe the error in the console: “Uncaught ** Assertion failed in Wijmo: Invalid argument: "value". Error”
5. Click on the second link displayed in the error message.
Place a breakpoint at the location and format the code.
Refresh the page, open developer tools and click again on “Export” button.
Format the code if required and press “F8” to pass the breakpoint this time.
Observe that the next time the flow hit the breakpoint, “e” contains an instance of “PdfPen” instead of “PdfPen2”.
Verifying that the issue does not occur in simple esbuild setup:
Run “npm i -f” to install the dependencies and open the sample either using “live server extension” or by running “npx http-server -o” command from terminal.
Click on the “Export” button.
Observe that the FlexGrid can be exported successfully.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
which is optimized (pre-bundled) to node_modules/.vite/deps/@mescius_wijmo__pdf.js like this (which references non-pre-bundled code and thus dual package issues):
The potential workaround is to exclude these packages from optimization since they are mostly bundled already. A following config makes your "export" button work in the reproduction:
Describe the bug
We have a FlexGridPdfConverter class in our library (Wijmo). When we use the draw() method to draw the FlexGrid into a PdfDocument it produces an error in the constole: “Uncaught ** Assertion failed in Wijmo: Invalid argument: "value". Error”.
The error is caused because of failure of following check: “e instanceof PdfPen”
The reason is that the “e” variable contains the instance of “PdfPen” instead of “PdfPen2”.
You may observe the same in the images below:
Please note that I tried to run the exact code in an esbuild setup, and the issue does not occur. In esbuild setup also, the names are modifed by appending the suitable number in front of classes.
Reproduction
https://stackblitz.com/edit/vitejs-vite-msmvhy?file=index.html
Steps to reproduce
Steps to replicate the issue:
1 Extract the sample: instanceof check issue.zip
2. Run “npm i -f” and “npm run dev” to install the dependencies and run the sample.
3. Click on the “Export” button.
4. Observe the error in the console: “Uncaught ** Assertion failed in Wijmo: Invalid argument: "value". Error”
5. Click on the second link displayed in the error message.
Verifying that the issue does not occur in simple esbuild setup:
Extract the sample: esbuild-purejs.zip
Run “npm i -f” to install the dependencies and open the sample either using “live server extension” or by running “npx http-server -o” command from terminal.
Click on the “Export” button.
Observe that the FlexGrid can be exported successfully.
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: