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

deep-equal 2.0.1 throws is-weakmap compiler error, 'return' outside of function (12:1) #79

Closed
n8sabes opened this issue Dec 17, 2019 · 5 comments

Comments

@n8sabes
Copy link

n8sabes commented Dec 17, 2019

Related to #78, deep-equal v2.0.1 is now causing a 'return' outside of function (12:1) compiler error from is-weakmap, subsequent fixes to is-map and is-set.

STEPS

yarn create react-app my-app --template typescript
cd my-app
yarn add deep-equal
vi src/index.tsx

# Add lines to index.tsx before render()
    import deepEqual from "deep-equal"; // NEW LINE
    deepEqual({}, {});                  // NEW LINE

yarn build

COMPILER ERROR:

Failed to compile.

./node_modules/is-weakmap/index.js
SyntaxError: .../my-app/node_modules/is-weakmap/index.js: 'return' outside of function (12:1)

  10 | 		return false;
  11 | 	};
> 12 | 	return;
     | 	^
  13 | }
  14 |
  15 | var $mapHas = $WeakMap ? $WeakMap.prototype.has : null;


error Command failed with exit code 1.
@ljharb
Copy link
Member

ljharb commented Dec 17, 2019

Looks like I need to make the same changes to is-weakmap and is-weakset.

@n8sabes

This comment has been minimized.

@ljharb

This comment has been minimized.

@ljharb
Copy link
Member

ljharb commented Dec 18, 2019

v2.0.1 of is-weakmap and is-weakset are released.

@n8sabes
Copy link
Author

n8sabes commented Dec 19, 2019

Thank you @ljharb -- Everything is working quite nicely again!!

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