Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rwaskiewicz/stencil-replacesync-reproduction
stencil-replacesync-reproduction for https://github.com/ionic-team/stencil/pull/3591
https://github.com/rwaskiewicz/stencil-replacesync-reproduction
Last synced: about 1 month ago
JSON representation
stencil-replacesync-reproduction for https://github.com/ionic-team/stencil/pull/3591
- Host: GitHub
- URL: https://github.com/rwaskiewicz/stencil-replacesync-reproduction
- Owner: rwaskiewicz
- Created: 2022-09-13T17:17:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-13T17:25:48.000Z (over 2 years ago)
- Last Synced: 2024-12-13T00:30:03.981Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 322 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This repo contains an attempt to reproduce https://github.com/ionic-team/stencil/pull/3591, using the steps outlined in the summary.
Those steps are replicated below:## Steps to Reproduce
- Created an Ionic React Starter
- Installed [`@happy-dom/jest-environment`](https://www.npmjs.com/package/@happy-dom/jest-environment)
- Updated the `test` script to assign the jest environment
- Install Ionic Dev build (due to this issue: https://github.com/ionic-team/ionic-framework/issues/25900)
```
npm install @ionic/[email protected] @ionic/[email protected]
```
- Run the test suite
- Observed: Exception is thrown for trying to perform `.replace` on `undefined`:
```
/Users/sean/Documents/ionic/issues/react-happy-dom/node_modules/happy-dom/lib/css/CSSParser.js:25
const css = cssText.replace(COMMENT_REGEXP, '');
^TypeError: Cannot read properties of undefined (reading 'replace')
at Function.parseFromString (/Users/sean/Documents/ionic/issues/react-happy-dom/node_modules/happy-dom/src/css/CSSParser.ts:23:23)
at CSSStyleSheet.replaceSync (/Users/sean/Documents/ionic/issues/react-happy-dom/node_modules/happy-dom/src/css/CSSStyleSheet.ts:129:3)
at registerStyle (/Users/sean/Documents/ionic/issues/react-happy-dom/node_modules/@stencil/core/internal/client/index.js:233:19)
```- Manually updated the compiled output to the changes proposed in this PR
- Re-ran test suite
- Observed: No exception is raised## This Repo
this repo contains four commits to try to reproduce the issue.
- a3a81a0e460379668d28245a1eb929006b1c2d94 is the output of `ionic start`, selecting 'React' and using a blank project
- 145eea2f12fbf8ab0f4ae2b304c7dec2c5fa9e52 is the result of running `npm i -D @happy-dom/jest-environment`
- 39a8a2389dd696ccb8a05db6a90368f80461c369 is the result of running `npm install @ionic/[email protected] @ionic/[email protected]`
- e63e3e4a288a3b0382ccdb9203b1f56644e451fa updates the `test` command per https://github.com/ionic-team/stencil/pull/3591#issuecomment-1242260324In running the test command with: `npm t -- --no-cache`, the test passes:
```
PASS src/App.test.tsx
✓ renders without crashing (28 ms)Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 2.876 s
Ran all test suites.Watch Usage: Press w to show more.
```rather than "Observed: Exception is thrown for trying to perform .replace on undefined"