Skip to content

make fluent-react.js in fluent-gecko fails #523

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

Closed
nchevobbe opened this issue Feb 5, 2021 · 2 comments
Closed

make fluent-react.js in fluent-gecko fails #523

nchevobbe opened this issue Feb 5, 2021 · 2 comments

Comments

@nchevobbe
Copy link

What I did:

  • At the root of the project, npm install
  • cd fluent-gecko
  • make fluent-react.js

I got an error message:

/Applications/Xcode.app/Contents/Developer/usr/bin/make -sC ../fluent-react compile
src/context.ts:1:31 - error TS2307: Cannot find module 'react' or its corresponding type declarations.

1 import { createContext } from "react";
                                ~~~~~~~

src/localization.ts:1:46 - error TS2307: Cannot find module '@fluent/bundle' or its corresponding type declarations.

1 import { FluentBundle, FluentVariable } from "@fluent/bundle";
                                               ~~~~~~~~~~~~~~~~

src/localization.ts:2:31 - error TS2307: Cannot find module '@fluent/sequence' or its corresponding type declarations.

2 import { mapBundleSync } from "@fluent/sequence";
                                ~~~~~~~~~~~~~~~~~~

src/localized.ts:9:8 - error TS2307: Cannot find module 'react' or its corresponding type declarations.

9 } from "react";
         ~~~~~~~

src/localized.ts:10:23 - error TS2307: Cannot find module 'prop-types' or its corresponding type declarations.

10 import PropTypes from "prop-types";
                         ~~~~~~~~~~~~

src/localized.ts:13:32 - error TS2307: Cannot find module '@fluent/bundle' or its corresponding type declarations.

13 import { FluentVariable } from "@fluent/bundle";
                                  ~~~~~~~~~~~~~~~~

src/localized.ts:150:51 - error TS7006: Parameter 'childNode' implicitly has an 'any' type.

150   const translatedChildren = translationNodes.map(childNode => {
                                                      ~~~~~~~~~

src/provider.ts:1:56 - error TS2307: Cannot find module 'react' or its corresponding type declarations.

1 import { createElement, ReactNode, ReactElement } from "react";
                                                         ~~~~~~~

src/provider.ts:2:23 - error TS2307: Cannot find module 'prop-types' or its corresponding type declarations.

2 import PropTypes from "prop-types";
                        ~~~~~~~~~~~~

src/use_localization.ts:1:28 - error TS2307: Cannot find module 'react' or its corresponding type declarations.

1 import { useContext } from "react";
                             ~~~~~~~

src/with_localization.ts:1:72 - error TS2307: Cannot find module 'react' or its corresponding type declarations.

1 import { createElement, useContext, ComponentType, ReactElement } from "react";
                                                                         ~~~~~~~

src/with_localization.ts:3:32 - error TS2307: Cannot find module '@fluent/bundle' or its corresponding type declarations.

3 import { FluentVariable } from "@fluent/bundle";
                                 ~~~~~~~~~~~~~~~~


Found 12 errors.

make[1]: *** [esm/.compiled] Error 2
make: *** [fluent-react.js] Error 2

After some search, I found that I needed npm i -D @types/react to get rid of the react ts errors,
and doing an npm install from the fluent-react folder eliminated all the errors.


It would be great if I wouldn't have to run those different commands that could be done directly within make fluent-react.js

@Pike
Copy link
Contributor

Pike commented Feb 5, 2021

Running make deps in the top-level after npm install works for me, at least on master.

@eemeli
Copy link
Member

eemeli commented Sep 14, 2021

Closing, as the build tooling was updated in #569. If you experience similar problems still, please open a new issue.

@eemeli eemeli closed this as completed Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants