wrapper.js:10 Uncaught TypeError: Cannot use 'in' operator to search for '_solidity_version' in undefined
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 349
- Avg merge
- 8m
- Merged PRs (30d)
- 1
Description
## Description
Hey guys, I have been trying to use solc in a React.js app for around a week now, and I can't get it to work!
I am importing solc using the following statements
import * as wrapper from 'solc/wrapper';
const solc = wrapper(window.Module);
However, upon compiling I get the following error in the browser
wrapper.js:10 Uncaught TypeError: Cannot use 'in' operator to search for '_solidity_version' in undefined
I've tried a number of ways around this, but none seem to work
Has anyone else had a similar issue?
Thanks
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the React import shown in the issue and inspect solc/wrapper.js at line 10, then reproduce the browser compilation error with the reported window.Module usage. Done means identifying the undefined value causing the '_solidity_version' lookup and confirming that compilation no longer throws the TypeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100