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

Warning in expo react native #69

Open
djaffer opened this issue Jan 18, 2025 · 2 comments
Open

Warning in expo react native #69

djaffer opened this issue Jan 18, 2025 · 2 comments

Comments

@djaffer
Copy link

djaffer commented Jan 18, 2025

WARNING in ./node_modules/expo-speech-recognition/build/index.js:2
export 'ExpoWebSpeechGrammar' (reexported as 'ExpoWebSpeechGrammar') was not found in './ExpoWebSpeechRecognition' (possible exports: ExpoWebSpeechGrammarList, ExpoWebSpeechRecognition, ExpoWebSpeechRecognitionEvent)
1 | import { ExpoSpeechRecognitionModule } from "./ExpoSpeechRecognitionModule";

2 | export { ExpoWebSpeechRecognition, ExpoWebSpeechGrammar, ExpoWebSpeechGrammarList } from "./ExpoWebSpeechRecognition";
3 | export { ExpoSpeechRecognitionModule } from "./ExpoSpeechRecognitionModule";
4 | export { useSpeechRecognitionEvent } from "./useSpeechRecognitionEvent";
5 | export { AVAudioSessionCategory, AVAudioSessionCategoryOptions, AVAudioSessionMode, RecognizerIntentExtraLanguageModel, RecognizerIntentEnableLanguageSwitch, AudioEncodingAndroid, TaskHintIOS } from "./constants";

@jamsch
Copy link
Owner

jamsch commented Jan 18, 2025

Hi @djaffer, could you give me more info?

  • Your package manager (npm, yarn, pnpm)
  • Your project structure (this error could happen in monorepos)
  • What command you're using to run the app bundler (e.g. npx expo start) (using a different bundler may cause this)
  • Your app metro & babel bundler configurations (a custom Metro or Babel plugin may cause this)
  • Any experiments enabled in app.json / app.config.js/ts (e.g. react compiler)
  • A code snippet of importing the library

@djaffer
Copy link
Author

djaffer commented Jan 20, 2025

  1. yarn
  2. Web, webpack, babel,
  3. expo start --web -c
  4. It is not a mono repo. Just react native expo.

babel.config.js

module.exports = function (api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],

    plugins: [
      'transform-inline-environment-variables',
      'react-native-paper/babel',
      '@babel/plugin-proposal-export-namespace-from',
      '@babel/plugin-transform-class-static-block',
      [
        'react-native-reanimated/plugin',
        {
          relativeSourceLocation: true,
        },
      ],
      [
        'babel-plugin-module-resolver',
        {
          alias: {
            'react-native-vector-icons': '@expo/vector-icons',
          },
        },
      ],
    ],
  };
};

metro config

const { getDefaultConfig } = require('expo/metro-config');

module.exports = (() => {
  const config = getDefaultConfig(__dirname);

  const { transformer, resolver } = config;

  config.transformer = {
    ...transformer,
    babelTransformerPath: require.resolve('react-native-svg-transformer'),
  };
  config.resolver = {
    ...resolver,
    assetExts: resolver.assetExts.filter((ext) => ext !== 'svg'),
    sourceExts: [...resolver.sourceExts, 'svg'],
  };

  return config;
})();

Usage

import {
  ExpoSpeechRecognitionModule,
  useSpeechRecognitionEvent,
} from 'expo-speech-recognition';

 useSpeechRecognitionEvent('start', () => {
  });
  useSpeechRecognitionEvent('end', async () => {
})
   ExpoSpeechRecognitionModule.start({
        lang: 'en-US',
        maxAlternatives: 1,
        volumeChangeEventOptions: {
          enabled: true,
        },
      });

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