Transitive dependency results in Vite build error while direct dependency does not

Describe the bug
When adding a dependency @cognite/3d-web-parser in package.json and importing something from it, everything runs fine.
However, when adding a dependency @cognite/3d-viewer which itself depends on @cognite/3d-web-parser and including something from @cognite/3d-viewer, Vite spits out a build error that it can not resolve the dependency @cognite/3d-web-parser with the below error message:
[plugin vite:dep-scan] Failed to resolve entry for package "@cognite/3d-web-parser". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "@cognite/3d-web-parser". The package may have incorrect main/module/exports specified in its package.json.
When looking at the @cognite/3d-web-parser#package.json#module entry, it does point to an existing index.es.js file that does seem to be in ESM format.
It might have something to do w/ yarn installing @cognite/3d-web-parser under node_modules/@cognite/3d-viewer/node_modules/3d-web-parser instead of installing it under @cognite/3d-web-parser.
I'm not sure why Yarn doesn't do that, though I'd also think that that shouldn't pose a problem to Vite.
Reproduction
https://github.com/Robin-Hoodie/vite-resolve-failure-repro
System Info
System:
    OS: macOS 12.3.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 4.00 GB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
    Yarn: 1.22.18 - ~/.nvm/versions/node/v16.13.1/bin/yarn
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
  Browsers:
    Brave Browser: <IP_ADDRESS>
    Chrome: 101.0.4951.54
    Safari: 15.4
  npmPackages:
    @vitejs/plugin-react: ^1.3.0 => 1.3.2
    vite: ^2.9.9 => 2.9.9

Used Package Manager
yarn
Logs
vite:config bundled config file loaded in 47.63ms +0ms
  vite:config using resolved config: {
  vite:config   plugins: [
  vite:config     'vite:pre-alias',
  vite:config     'alias',
  vite:config     'vite:react-babel',
  vite:config     'vite:react-refresh',
  vite:config     'vite:react-jsx',
  vite:config     'vite:modulepreload-polyfill',
  vite:config     'vite:resolve',
  vite:config     'vite:optimized-deps',
  vite:config     'vite:html-inline-proxy',
  vite:config     'vite:css',
  vite:config     'vite:esbuild',
  vite:config     'vite:json',
  vite:config     'vite:wasm',
  vite:config     'vite:worker',
  vite:config     'vite:asset',
  vite:config     'vite:define',
  vite:config     'vite:css-post',
  vite:config     'vite:worker-import-meta-url',
  vite:config     'vite:client-inject',
  vite:config     'vite:import-analysis'
  vite:config   ],
  vite:config   server: {
  vite:config     preTransformRequests: true,
  vite:config     https: true,
  vite:config     fs: { strict: true, allow: [Array], deny: [Array] }
  vite:config   },
  vite:config   resolve: { dedupe: [ 'react', 'react-dom' ], alias: [ [Object], [Object] ] },
  vite:config   optimizeDeps: {
  vite:config     include: [ 'react/jsx-dev-runtime' ],
  vite:config     esbuildOptions: { keepNames: undefined, preserveSymlinks: undefined }
  vite:config   },
  vite:config   configFile: '/Users/robin/development/cognite/vite-resolve-failure-repro/vite.config.ts',
  vite:config   configFileDependencies: [
  vite:config     '/Users/robin/development/cognite/vite-resolve-failure-repro/vite.config.ts'
  vite:config   ],
  vite:config   inlineConfig: {
  vite:config     root: undefined,
  vite:config     base: undefined,
  vite:config     mode: undefined,
  vite:config     configFile: undefined,
  vite:config     logLevel: undefined,
  vite:config     clearScreen: undefined,
  vite:config     server: {}
  vite:config   },
  vite:config   root: '/Users/robin/development/cognite/vite-resolve-failure-repro',
  vite:config   base: '/',
  vite:config   publicDir: '/Users/robin/development/cognite/vite-resolve-failure-repro/public',
  vite:config   cacheDir: '/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/.vite',
  vite:config   command: 'serve',
  vite:config   mode: 'development',
  vite:config   isWorker: false,
  vite:config   isProduction: false,
  vite:config   build: {
  vite:config     target: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
  vite:config     polyfillModulePreload: true,
  vite:config     outDir: 'dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     cssCodeSplit: true,
  vite:config     cssTarget: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
  vite:config     sourcemap: false,
  vite:config     rollupOptions: {},
  vite:config     minify: 'esbuild',
  vite:config     terserOptions: {},
  vite:config     write: true,
  vite:config     emptyOutDir: null,
  vite:config     manifest: false,
  vite:config     lib: false,
  vite:config     ssr: false,
  vite:config     ssrManifest: false,
  vite:config     reportCompressedSize: true,
  vite:config     chunkSizeWarningLimit: 500,
  vite:config     watch: null,
  vite:config     commonjsOptions: { include: [Array], extensions: [Array] },
  vite:config     dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] }
  vite:config   },
  vite:config   preview: {
  vite:config     port: undefined,
  vite:config     strictPort: undefined,
  vite:config     host: undefined,
  vite:config     https: true,
  vite:config     open: undefined,
  vite:config     proxy: undefined,
  vite:config     cors: undefined,
  vite:config     headers: undefined
  vite:config   },
  vite:config   env: { BASE_URL: '/', MODE: 'development', DEV: true, PROD: false },
  vite:config   assetsInclude: [Function: assetsInclude],
  vite:config   logger: {
  vite:config     hasWarned: false,
  vite:config     info: [Function: info],
  vite:config     warn: [Function: warn],
  vite:config     warnOnce: [Function: warnOnce],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen],
  vite:config     hasErrorLogged: [Function: hasErrorLogged]
  vite:config   },
  vite:config   packageCache: Map(0) {},
  vite:config   createResolver: [Function: createResolver],
  vite:config   worker: {
  vite:config     format: 'iife',
  vite:config     plugins: [
  vite:config       [Object], [Object],
  vite:config       [Object], [Object],
  vite:config       [Object], [Object],
  vite:config       [Object], [Object],
  vite:config       [Object], [Object],
  vite:config       [Object], [Object],
  vite:config       [Object], [Object],
  vite:config       [Object], [Object],
  vite:config       [Object]
  vite:config     ],
  vite:config     rollupOptions: {}
  vite:config   }
  vite:config } +3ms

  vite v2.9.9 dev server running at:

  > Local: https://localhost:3000/
  > Network: use `--host` to expose

  ready in 115ms.

  vite:deps scanning for dependencies... { timestamp: true } +0ms
  vite:deps Crawling dependencies using entries:
  vite:deps   /Users/robin/development/cognite/vite-resolve-failure-repro/index.html +0ms
  vite:resolve 0.26ms /src/main.tsx -> /Users/robin/development/cognite/vite-resolve-failure-repro/src/main.tsx +0ms
  vite:resolve 1.15ms react -> /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/react/index.js +1ms
  vite:resolve 0.50ms react-dom/client -> /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/react-dom/client.js +1ms
  vite:resolve 0.30ms ./App -> /Users/robin/development/cognite/vite-resolve-failure-repro/src/App.tsx +1ms
  vite:resolve 0.42ms @cognite/3d-viewer -><EMAIL_ADDRESS>+1ms
  vite:deps Scan completed in 17.34ms: {
  react: '/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/react/index.js',
  'react-dom/client': '/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/react-dom/client.js',
  '@cognite/3d-viewer': <EMAIL_ADDRESS>} +9ms
  vite:resolve 0.31ms react/jsx-dev-runtime -> /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/react/jsx-dev-runtime.js +0ms
  vite:deps dependencies found: @cognite/3d-viewer
  vite:deps   react
  vite:deps   react-dom/client
  vite:deps   react/jsx-dev-runtime { timestamp: true } +25ms
  vite:resolve 0.30ms react-dom -> /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/react-dom/index.js +0ms
  vite:resolve 0.29ms react -> /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/react/index.js +3ms
  vite:resolve 1.44ms @babel/runtime/regenerator -><EMAIL_ADDRESS>+9ms
  vite:resolve 1.58ms @babel/runtime/helpers/asyncToGenerator -><EMAIL_ADDRESS>+2ms
  vite:resolve 1.20ms @babel/runtime/helpers/classCallCheck -><EMAIL_ADDRESS>+1ms
  vite:resolve 1.41ms @babel/runtime/helpers/createClass -><EMAIL_ADDRESS>+2ms
  vite:resolve 0.57ms @tweenjs/tween.js -><EMAIL_ADDRESS>+1ms
  vite:resolve 0.37ms three -><EMAIL_ADDRESS>+0ms
  vite:resolve 1.21ms @babel/runtime/helpers/toConsumableArray -><EMAIL_ADDRESS>+2ms
  vite:resolve 0.24ms right-now -> /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/right-now/browser.js +0ms
✘ [ERROR] [plugin vite:dep-pre-bundle] Failed to resolve entry for package "@cognite/3d-web-parser". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "@cognite/3d-web-parser". The package may have incorrect main/module/exports specified in its package.json.

    node_modules/vite/dist/node/chunks/dep-59dc6e00.js:40662:10:
      40662 │     throw new Error(`Failed to resolve entry for package "${id}". ` +
            ╵           ^

    at packageEntryFailure (/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:40662:11)
    at resolvePackageEntry (/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:40658:9)
    at tryNodeResolve (/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:40465:20)
    at Context.resolveId (/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:40273:28)
    at Object.resolveId (/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:38837:55)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:61503:27
    at async /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:38354:34
    at async callback (/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/esbuild/lib/main.js:921:28)
    at async handleRequest (/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/esbuild/lib/main.js:701:30)

  This error came from the "onResolve" callback registered here:

    node_modules/vite/dist/node/chunks/dep-59dc6e00.js:38333:18:
      38333 │             build.onResolve({ filter: /^[\w@][^:]/ }, async ({ path: id, importer, kind }) => {
            ╵                   ~~~~~~~~~

    at setup (/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:38333:19)
    at handlePlugins (/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/esbuild/lib/main.js:843:23)
    at Object.buildOrServe (/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/esbuild/lib/main.js:1137:7)
    at /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/esbuild/lib/main.js:2079:17
    at new Promise (<anonymous>)
    at Object.build (/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/esbuild/lib/main.js:2078:14)
    at Object.build (/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/esbuild/lib/main.js:1927:51)
    at runOptimizeDeps (/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:39574:34)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

  The plugin "vite:dep-pre-bundle" was triggered by this import

    node_modules/@cognite/3d-viewer/dist/cognite.module.js:1:4088:
      1 │ ...rray")},function(e,t){e.exports=require("right-now")},function(e,t){e.exports=require("@cognite/3d-web-parser")},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object....
        ╵                                                                                ~~~~~~~~~~~~~~~~~~~~~~~~

  vite:resolve 0.69ms is-function -> /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/is-function/index.js +26ms
  vite:resolve 0.40ms scheduler -> /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/scheduler/index.js +1ms
  vite:resolve 0.40ms mouse-event-offset -> /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/mouse-event-offset/index.js +0ms
  vite:resolve 1.17ms @babel/runtime/helpers/defineProperty -><EMAIL_ADDRESS>+1ms
  vite:resolve 0.25ms @cognite/three-combo-controls -> /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/<EMAIL_ADDRESS>+1ms
  vite:resolve 0.95ms @babel/runtime/helpers/slicedToArray -><EMAIL_ADDRESS>+1ms
  vite:resolve 0.88ms @babel/runtime/helpers/typeof -><EMAIL_ADDRESS>+1ms
  vite:resolve 0.22ms mixpanel-browser -> /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/mixpanel-browser/dist/mixpanel.cjs.js +0ms
  vite:resolve 0.27ms simple-statistics -> /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/simple-statistics/dist/simple-statistics.js +0ms
  vite:resolve 0.28ms regenerator-runtime -> /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/regenerator-runtime/runtime.js +1ms
12:24:42 PM [vite] error while updating dependencies:
Error: Build failed with 1 error:
node_modules/vite/dist/node/chunks/dep-59dc6e00.js:40662:10: ERROR: [plugin: vite:dep-pre-bundle] Failed to resolve entry for package "@cognite/3d-web-parser". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "@cognite/3d-web-parser". The package may have incorrect main/module/exports specified in its package.json.
    at failureErrorWithLog (/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/esbuild/lib/main.js:1603:15)
    at /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/esbuild/lib/main.js:1249:28
    at runOnEndCallbacks (/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/esbuild/lib/main.js:1034:63)
    at buildResponseToResult (/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/esbuild/lib/main.js:1247:7)
    at /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/esbuild/lib/main.js:1356:14
    at /Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/esbuild/lib/main.js:666:9
    at handleIncomingPacket (/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/esbuild/lib/main.js:763:9)
    at Socket.readFromStdout (/Users/robin/development/cognite/vite-resolve-failure-repro/node_modules/esbuild/lib/main.js:632:7)
    at Socket.emit (node:events:390:28)
    at addChunk (node:internal/streams/readable:315:12)

Validations

[X] Follow our Code of Conduct
[X] Read the Contributing Guidelines.
[X] Read the docs.
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
[X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
[X] The provided reproduction is a minimal reproducible example of the bug.

The direct reason is @cognite/3d-web-parser's browser field points to a non-existant file (dist/main.js).
The behavior difference between direct and transitive dep comes from the difference of Vite's resolver and esbuild's resolver. esbuild's one fallbacks to another entry point if the browser field points to a file which does not exist. Vite's one does not do that.

@sapphi-red Thanks for the answer.  If that's the case, doesn't that mean that you meant it the other way around and that Vite does fallback and ESBuild does not?
Also, is there a reason why both prefer the browser field over the module field if both tools prefer ES Modules?

ESBuild resolves transitive dependencies, while Vite resolves direct dependencies.

Partially yes.
Vite uses esbuild with Vite's resolver plugin. So... I am a bit lying here.
I forgot the details but I remember I confirmed that Vite does not fallback and esbuild (without Vite's resolver plugin) does fallback.

is there a reason why both prefer the browser field over the module field if both tools prefer ES Modules?

I think this is the reason.
https://twitter.com/youyuxi/status/1348413401299562497

Thanks for the context.
Reading Evan's comment, I wasn't even aware there was a difference between NodeJS ESM & browser ESM. Isn't the whole point of ESM to have a module format that works for both?

The formats are same. browser ESM stands for ESM with browser specific code (like window.alert).

The formats are same. browser ESM stands for ESM with browser specific code (like window.alert).

That makes sense. Thanks for all the help!
Closing this as the issue lies in @cognite/3d-web-parser and its package.json#browser entry


🐛 [firebase_messaging] Uncaught [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()

Bug report
I migrated to 2.8 and tried to use the dart-only firebase messaging that comes with it as described in https://medium.com/flutter/whats-new-in-flutter-2-8-d085b763d181. However; I get this old error, to fix which one needed the firebase JS files loaded and having extra code to initialise firebase app in index.html (or using an extra firebase-messaging-sw.js to have the initialisation code).
I did follow all the steps including creating the firebase_options.dart file through flutterfire CLI and calling the appropriate sequence of steps, which has not changed much anyway except that the dart code now initializes the firebase app on web, too.

Steps to reproduce
No matter which method I try: loading main.dart.js through service worker or directly through a script tag, or even the hacky and desperate stuff of trying both, I get this error.
index.html
<!DOCTYPE html>
<html>
  <head>
    <base href="/" />
    <meta charset="UTF-8" />
    <meta content="IE=Edge" http-equiv="X-UA-Compatible" />
    <meta name="description" content="A new Flutter project." />
    <!-- iOS meta tags & icons -->
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="apple-mobile-web-app-title" content="dhwanilaya" />
    <link rel="apple-touch-icon" href="icons/Icon-192.png" />
    <!-- Favicon -->
    <link rel="icon" type="image/png" href="favicon.png" />
    <title>Dhwanilaya</title>
    <link rel="manifest" href="manifest.json" />
  </head>
  <body style="background-color: transparent">
    <!-- Placeholder -->
    <div
      id="wait-message-initial"
      style="
        text-align: center;
        margin-top: 80px;
        background-color: transparent;
      "
    >
      <img style="height: 80px" src="assets/assets/svg/logo/logo-srgb.svg" />
      <div
        style="
          font-family: sans-serif;
          font-weight: 300;
          font-size: 24px;
          margin-top: 80px;
        "
      >
        Dhwanilaya will load in a few moments...
      </div>
    </div>
    <!-- PDF.js load and init -->
    <script src="//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.4.456/pdf.min.js"></script>
    <script type="text/javascript">
      pdfjsLib.GlobalWorkerOptions.workerSrc =
        "//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.4.456/pdf.worker.min.js";
      pdfRenderOptions = {
        cMapUrl<EMAIL_ADDRESS>        cMapPacked: true,
      };
    </script>
    <!-- Agora wrapper load -->
    <script src="AgoraRtcWrapper.r9ce65cd.js"></script>
    <script src="main.dart.js" type="application/javascript"></script>
    <!--script>
      var serviceWorkerVersion = null;
      var scriptLoaded = false;
      function loadMainDartJs() {
        if (scriptLoaded) {
          return;
        }
        scriptLoaded = true;
        var scriptTag = document.createElement("script");
        scriptTag.src = "main.dart.js";
        scriptTag.type = "application/javascript";
        document.body.append(scriptTag);
      }

      if ("serviceWorker" in navigator) {
        // Service workers are supported. Use them.
        window.addEventListener("load", function () {
          //register firebase-messaging service worker
          // navigator.serviceWorker.register("/firebase-messaging-sw.js");
          // Wait for registration to finish before dropping the <script> tag.
          // Otherwise, the browser will load the script multiple times,
          // potentially different versions.
          var serviceWorkerUrl =
            "flutter_service_worker.js?v=" + serviceWorkerVersion;

          navigator.serviceWorker.register(serviceWorkerUrl).then((reg) => {
            function waitForActivation(serviceWorker) {
              serviceWorker.addEventListener("statechange", () => {
                if (serviceWorker.state == "activated") {
                  console.log("Installed new service worker.");
                  loadMainDartJs();
                }
              });
            }
            if (!reg.active && (reg.installing || reg.waiting)) {
              // No active web worker and we have installed or are installing
              // one for the first time. Simply wait for it to activate.
              waitForActivation(reg.installing ?? reg.waiting);
            } else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) {
              // When the app updates the serviceWorkerVersion changes, so we
              // need to ask the service worker to update.
              console.log("New service worker available.");
              reg.update();
              waitForActivation(reg.installing);
            } else {
              // Existing service worker is still good.
              console.log("Loading app from service worker.");
              loadMainDartJs();
            }
          });

          // If service worker doesn't succeed in a reasonable amount of time,
          // fallback to plaint <script> tag.
          setTimeout(() => {
            if (!scriptLoaded) {
              console.warn(
                "Failed to load app from service worker. Falling back to plain <script> tag."
              );
              loadMainDartJs();
            }
          }, 4000);
        });
      } else {
        // Service workers not supported. Just drop the <script> tag.
        loadMainDartJs();
      }
    </script-->
  </body>
</html>

app
Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await initPushNotifications(
    name: "Dhwanilaya",
    options: DefaultFirebaseOptions.currentPlatform,
    mobileOptions: MobilePushNotificationOptions(
      id: "com.dhwanilaya.app",
      title: "Dhwanilaya",
      description:
          "This channel is used for Dhwanilaya app push notifications.",
    ),
  );
...
runApp(...);
}

Future<void> initPushNotifications({
  required final String name,
  required final FirebaseOptions options,
  required final MobilePushNotificationOptions mobileOptions,
}) async {
  PushNotificationService.options = options;
  await Firebase.initializeApp(name: name, options: options);
  if (!kIsWeb) {
    await _initPushNotificationsMobile(mobileOptions: mobileOptions);
  } else {
    await _initPushNotificationsWeb();
  }
}

Future<void> _backgroundPushNotificationHandler(
  final RemoteMessage message,
) async {
  await Firebase.initializeApp(options: PushNotificationService.options);
  infoLog('Handling a background message ${message.messageId}');
}

Future<void> _initPushNotificationsMobile({
  required final MobilePushNotificationOptions mobileOptions,
}) async {
  if (Platform.isAndroid) {
    FirebaseMessaging.onBackgroundMessage(_backgroundPushNotificationHandler);
  }
  PushNotificationService.channel = AndroidNotificationChannel(
    mobileOptions.id,
    mobileOptions.title,
    description: mobileOptions.description,
    importance: Importance.high,
  );
  PushNotificationService.localNotificationsPlugin =
      FlutterLocalNotificationsPlugin();
  PushNotificationService.permissionsObtained =
      await PushNotificationService.localNotificationsPlugin!.initialize(
    Platform.isAndroid
        ? const InitializationSettings(
            android: AndroidInitializationSettings("@mipmap/launch_image"),
          )
        : const InitializationSettings(iOS: IOSInitializationSettings()),
    onSelectNotification: (final payload) async {
      try {
        await GetIt.I<PushNotificationService>()
            .handleNotificationSelection(payload);
      } on Exception catch (error, stack) {
        errorLog(error.toString());
        errorLog(stack.toString());
      }
    },
  );
  if (PushNotificationService.permissionsObtained ?? false) {
    if (Platform.isAndroid) {
      await PushNotificationService.localNotificationsPlugin!
          .resolvePlatformSpecificImplementation<
              AndroidFlutterLocalNotificationsPlugin>()
          ?.createNotificationChannel(PushNotificationService.channel!);
    } else if (Platform.isIOS) {
      final impl = PushNotificationService.localNotificationsPlugin!
          .resolvePlatformSpecificImplementation<
              IOSFlutterLocalNotificationsPlugin>()!;
      PushNotificationService.permissionsObtained =
          await impl.requestPermissions(
        alert: true,
        badge: true,
        sound: true,
      );
      if (PushNotificationService.permissionsObtained ?? false) {
        await FirebaseMessaging.instance
            .setForegroundNotificationPresentationOptions();
      }
    }
  }
}

Future<void> _initPushNotificationsWeb() async {
  var notificationSettings =
      await FirebaseMessaging.instance.getNotificationSettings();
  if (notificationSettings.authorizationStatus ==
      AuthorizationStatus.notDetermined) {
    notificationSettings = await FirebaseMessaging.instance.requestPermission();
  }
  PushNotificationService.permissionsObtained =
      notificationSettings.authorizationStatus != AuthorizationStatus.denied;
}

Crash on web
Uncaught [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()
    at Object.wrapException (https://dev-portal.dhwanilaya.com/main.dart.js:8109:17)
    at FirebaseCoreWeb.app$1 (https://dev-portal.dhwanilaya.com/main.dart.js:131820:19)
    at https://dev-portal.dhwanilaya.com/main.dart.js:21052:114
    at _wrapJsFunctionForAsync_closure.$protected (https://dev-portal.dhwanilaya.com/main.dart.js:10682:15)
    at _wrapJsFunctionForAsync_closure.call$2 (https://dev-portal.dhwanilaya.com/main.dart.js:86040:12)
    at Object._asyncStartSync (https://dev-portal.dhwanilaya.com/main.dart.js:10646:20)
    at Object._initPushNotificationsWeb (https://dev-portal.dhwanilaya.com/main.dart.js:21079:16)
    at https://dev-portal.dhwanilaya.com/main.dart.js:21031:38
    at _wrapJsFunctionForAsync_closure.$protected (https://dev-portal.dhwanilaya.com/main.dart.js:10682:15)
    at _wrapJsFunctionForAsync_closure.call$2 (https://dev-portal.dhwanilaya.com/main.dart.js:86040:12)
(index):82

Flutter doctor
Click To Expand
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.0, on macOS 12.0.1 21A559 darwin-x64, locale en-IN)
[✗] Android toolchain - develop for Android devices
    ✗ ANDROID_HOME = /Volumes/BIGDATA/Storage/Android/SDK
      but Android SDK not found at this location.
[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] VS Code (version 1.63.1)
[✓] Connected device (1 available)

! Doctor found issues in 2 categories.

Flutter dependencies
Click To Expand
Dart SDK 2.15.0
Flutter SDK 2.8.0
dhwanilaya 0.28.1+60

dependencies:
- app_framework 0.20.0+beta1 [crypto cupertino_icons custom_pop_up_menu expandable file_picker firebase_core firebase_messaging flutter flutter_app_badger flutter_easyrefresh flutter_local_notifications flutter_svg flutter_typeahead font_awesome_flutter form_field_validator get_it google_fonts hive http http_parser json_annotation just_audio logging path_provider steps_indicator superellipse_shape table_calendar universal_html universal_io url_launcher video_player vrouter]
- file_picker 4.2.7 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface ffi path]
- firebase_core 1.10.5 [firebase_core_platform_interface firebase_core_web flutter meta]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]
- font_awesome_flutter 9.0.0 [flutter]
- form_field_validator 1.1.0 [flutter intl]
- get_it 7.2.0 [async collection]
- json_annotation 4.4.0 [meta]
- pdf_render 1.0.18 [collection flutter flutter_web_plugins js plugin_platform_interface vector_math]
- permission_handler 8.3.0 [flutter meta permission_handler_platform_interface]
- superellipse_shape 0.2.0 [flutter]
- table_calendar 3.0.3 [flutter intl simple_gesture_detector]
- universal_html 2.0.8 [async csslib charcode collection html meta source_span typed_data universal_io]
- universal_io 2.0.4 [collection crypto meta typed_data]
- upi_pay 1.0.1 [flutter decimal universal_io]
- video_call_framework 0.3.1 [agora_rtc_engine app_framework flutter get_it json_annotation logging permission_handler universal_io]
- webview_flutter 3.0.0 [flutter webview_flutter_android webview_flutter_platform_interface webview_flutter_wkwebview]

dev dependencies:
- build_runner 2.1.5 [args async analyzer build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml]
- flutter_driver 0.0.0 [file flutter flutter_test fuchsia_remote_debug_protocol path meta vm_service webdriver archive async boolean_selector characters charcode clock collection crypto matcher platform process source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vector_math]
- flutter_lints 1.0.4 [lints]
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]
- json_serializable 6.1.1 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper]

transitive dependencies:
- _fe_analyzer_shared 31.0.0 [meta]
- agora_rtc_engine 4.1.0-alpha.2 [flutter flutter_web_plugins js json_annotation ffi]
- analyzer 2.8.0 [_fe_analyzer_shared cli_util collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- archive 3.1.6 [crypto path]
- args 2.3.0
- async 2.8.2 [collection meta]
- audio_session 0.1.6+1 [flutter flutter_web_plugins rxdart meta]
- boolean_selector 2.1.0 [source_span string_scanner]
- build 2.1.1 [analyzer async convert crypto glob logging meta path]
- build_config 1.0.0 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 3.0.1 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_resolvers 2.0.4 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml]
- build_runner_core 7.2.2 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pool timing watcher yaml]
- built_collection 5.1.1
- built_value 8.1.3 [built_collection collection fixnum meta]
- characters 1.2.0
- charcode 1.3.1
- checked_yaml 2.0.1 [json_annotation source_span yaml]
- cli_util 0.3.5 [meta path]
- clock 1.1.0
- code_builder 4.1.0 [built_collection built_value collection matcher meta]
- collection 1.15.0
- convert 3.0.1 [typed_data]
- crypto 3.0.1 [collection typed_data]
- csslib 0.17.1 [source_span]
- cupertino_icons 1.0.4
- custom_pop_up_menu 1.2.2 [flutter]
- dart_style 2.1.1 [analyzer args path pub_semver source_span]
- dbus 0.6.6 [args ffi meta xml]
- decimal 1.5.0 [rational]
- expandable 5.0.1 [flutter]
- fake_async 1.2.0 [clock collection]
- ffi 1.1.2
- file 6.1.2 [meta path]
- firebase_core_platform_interface 4.2.2 [collection flutter meta plugin_platform_interface]
- firebase_core_web 1.5.2 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_messaging 11.2.3 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
- firebase_messaging_platform_interface 3.1.3 [firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_web 2.2.4 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta]
- fixnum 1.0.0
- flutter_app_badger 1.3.0 [flutter]
- flutter_easyrefresh 2.2.1 [flutter]
- flutter_keyboard_visibility 5.1.0 [meta flutter_keyboard_visibility_platform_interface flutter_keyboard_visibility_web flutter]
- flutter_keyboard_visibility_platform_interface 2.0.0 [flutter meta plugin_platform_interface]
- flutter_keyboard_visibility_web 2.0.0 [flutter_keyboard_visibility_platform_interface flutter_web_plugins flutter]
- flutter_local_notifications 9.1.5 [clock flutter flutter_local_notifications_linux flutter_local_notifications_platform_interface timezone]
- flutter_local_notifications_linux 0.4.0 [flutter flutter_local_notifications_platform_interface dbus path xdg_directories]
- flutter_local_notifications_platform_interface 5.0.0 [flutter plugin_platform_interface]
- flutter_plugin_android_lifecycle 2.0.5 [flutter]
- flutter_svg 1.0.0 [flutter meta path_drawing vector_math xml]
- flutter_typeahead 3.2.4 [flutter flutter_keyboard_visibility]
- flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math]
- frontend_server_client 2.1.2 [async path]
- fuchsia_remote_debug_protocol 0.0.0 [process vm_service file meta path platform]
- glob 2.0.2 [async collection file path string_scanner]
- google_fonts 2.1.0 [flutter http path_provider crypto]
- graphs 2.1.0 [collection]
- hive 2.0.4 [meta crypto]
- html 0.15.0 [csslib source_span]
- http 0.13.4 [async http_parser meta path]
- http_multi_server 3.0.1 [async]
- http_parser 4.0.0 [charcode collection source_span string_scanner typed_data]
- intl 0.17.0 [clock path]
- io 1.0.3 [meta path string_scanner]
- js 0.6.3
- just_audio 0.9.18 [just_audio_platform_interface just_audio_web audio_session rxdart path path_provider async uuid crypto meta flutter]
- just_audio_platform_interface 4.0.0 [flutter plugin_platform_interface]
- just_audio_web 0.4.2 [just_audio_platform_interface flutter flutter_web_plugins]
- lints 1.0.1
- logging 1.0.2
- matcher 0.12.11 [stack_trace]
- meta 1.7.0
- mime 1.0.1
- move_to_background 1.0.2 [flutter]
- package_config 2.0.2 [path]
- path 1.8.0
- path_drawing 1.0.0 [vector_math meta path_parsing flutter]
- path_parsing 1.0.0 [vector_math meta]
- path_provider 2.0.8 [flutter path_provider_android path_provider_ios path_provider_linux path_provider_macos path_provider_platform_interface path_provider_windows]
- path_provider_android 2.0.9 [flutter path_provider_platform_interface]
- path_provider_ios 2.0.7 [flutter path_provider_platform_interface]
- path_provider_linux 2.1.2 [flutter path path_provider_platform_interface xdg_directories]
- path_provider_macos 2.0.3 [flutter]
- path_provider_platform_interface 2.0.1 [flutter meta platform plugin_platform_interface]
- path_provider_windows 2.0.4 [ffi flutter meta path path_provider_platform_interface win32]
- pedantic 1.11.1
- permission_handler_platform_interface 3.7.0 [flutter meta plugin_platform_interface]
- petitparser 4.4.0 [meta]
- platform 3.0.2
- plugin_platform_interface 2.0.2 [meta]
- pool 1.5.0 [async stack_trace]
- process 4.2.4 [file path platform]
- pub_semver 2.1.0 [collection meta]
- pubspec_parse 1.1.0 [checked_yaml collection json_annotation pub_semver yaml]
- rational 1.2.1
- rxdart 0.27.3
- shelf 1.2.0 [async collection http_parser path stack_trace stream_channel]
- shelf_web_socket 1.0.1 [shelf stream_channel web_socket_channel]
- simple_gesture_detector 0.2.0 [flutter]
- sky_engine 0.0.99
- source_gen 1.0.3 [analyzer async build dart_style glob meta path pedantic source_span yaml]
- source_helper 1.3.0 [analyzer collection source_gen]
- source_span 1.8.1 [collection path term_glyph]
- stack_trace 1.10.0 [path]
- steps_indicator 1.3.0 [flutter]
- stream_channel 2.1.0 [async]
- stream_transform 2.0.0
- string_scanner 1.1.0 [charcode source_span]
- sync_http 0.3.0
- term_glyph 1.2.0
- test_api 0.4.3 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]
- timezone 0.8.0 [path]
- timing 1.0.0 [json_annotation]
- typed_data 1.3.0 [collection]
- url_launcher 6.0.17 [flutter meta url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]
- url_launcher_android 6.0.13 [flutter meta url_launcher_platform_interface]
- url_launcher_ios 6.0.13 [flutter meta url_launcher_platform_interface]
- url_launcher_linux 2.0.2 [flutter]
- url_launcher_macos 2.0.2 [flutter]
- url_launcher_platform_interface 2.0.4 [flutter plugin_platform_interface]
- url_launcher_web 2.0.4 [flutter flutter_web_plugins meta url_launcher_platform_interface]
- url_launcher_windows 2.0.2 [flutter]
- url_strategy 0.2.0 [flutter_web_plugins]
- uuid 3.0.5 [crypto]
- vector_math 2.1.1
- video_player 2.2.7 [flutter meta video_player_platform_interface video_player_web html]
- video_player_platform_interface 4.2.0 [flutter flutter_test meta]
- video_player_web 2.0.4 [flutter flutter_web_plugins meta video_player_platform_interface]
- vm_service 7.3.0
- vrouter 1.2.0+15 [flutter url_strategy url_launcher move_to_background]
- watcher 1.0.1 [async path]
- web_socket_channel 2.1.0 [async crypto stream_channel]
- webdriver 3.0.0 [archive matcher path stack_trace sync_http]
- webview_flutter_android 2.8.0 [flutter webview_flutter_platform_interface]
- webview_flutter_platform_interface 1.8.0 [flutter plugin_platform_interface]
- webview_flutter_wkwebview 2.7.1 [flutter webview_flutter_platform_interface]
- win32 2.3.1 [ffi]
- xdg_directories 0.2.0 [meta path process]
- xml 5.3.1 [collection meta petitparser]
- yaml 3.1.0 [collection source_span string_scanner]

I ran the firebase_messaging example using chrome debug; and that works. I cloned it today.
commit 3b3c2d163cdc1477b2e5fbe748b3cfb2c0847389 (HEAD -> master, origin/master, origin/HEAD)
Author: Remi Rousselet<EMAIL_ADDRESS>Date:   Wed Dec 15 13:08:51 2021 +0100

    Fix invalid generated code when a model has no queryable field

    fixes #7604

However; I noted few things in the example being different from how we are being told to go about.

I get some build specific messages which I wanted to mention:

rrair:flutterfire reeteshranjan$ cd packages/firebase_messaging/firebase_messaging/example/
rrair:example reeteshranjan$ flutter run
Warning: You are using these overridden dependencies:
! firebase_core 1.10.5 from path ../../../firebase_core/firebase_core
! firebase_core_platform_interface 4.2.2 from path ../../../firebase_core/firebase_core_platform_interface
! firebase_core_web 1.5.2 from path ../../../firebase_core/firebase_core_web
! firebase_messaging 11.2.3 from path ..
! firebase_messaging_platform_interface 3.1.3 from path ../../firebase_messaging_platform_interface
! firebase_messaging_web 2.2.4 from path ../../firebase_messaging_web
! plugin_platform_interface 2.0.2
Running "flutter pub get" in example...                             7.4s

The example is not using the newly generated firebase_config.dart yet. It has the following code:

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(
    options: const FirebaseOptions(
      apiKey: 'AIzaSyAHAsf51D0A407EklG1bs-5wA7EbyfNFg0',
      appId: '1:448618578101:ios:2bc5c1fe2ec336f8ac3efc',
      messagingSenderId: '448618578101',
      projectId: 'react-native-firebase-testing',
    ),
  );
...
}

So I changed the code to include the generated config, just to see if it creates any difference:
Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(
    options: DefaultFirebaseConfig.platformOptions,
  );
...
}

Things work even with that change. Then I looked to see if there is any issue with the generated config for my project; but I do not find any. My generated config has 7 keys: apiKey, appId, messagingSenderId, projectId, authDomain, storageBucket, and measurementId;
I really cannot make out what's the difference in my code and the example in terms of flow of calls made to different functions.

I saw a difference from the example that I was looking to ask for notifications permissions in web initialisation. I disabled that. The way my app goes is as follows: when the app begins, it goes to an initialisation route, and in its initState() method looks to do various initialisations that include the firebase messaging initialisations like done in the example app. Here is what my push notification service looks like. It is one of the services that my app uses.
push notification service
Future<void> initPushNotifications({
  required final String name,
  required final FirebaseOptions options,
  required final MobilePushNotificationOptions mobileOptions,
}) async {
  PushNotificationService.options = options;
  await Firebase.initializeApp(name: name, options: options);
  if (!kIsWeb) {
    await _initPushNotificationsMobile(mobileOptions: mobileOptions);
  } else {
    await _initPushNotificationsWeb();
  }
}

Future<void> _backgroundPushNotificationHandler(
  final RemoteMessage message,
) async {
  await Firebase.initializeApp(options: PushNotificationService.options);
  infoLog('Handling a background message ${message.messageId}');
}

Future<void> _initPushNotificationsMobile({
  required final MobilePushNotificationOptions mobileOptions,
}) async {
  if (Platform.isAndroid) {
    FirebaseMessaging.onBackgroundMessage(_backgroundPushNotificationHandler);
  }
  PushNotificationService.channel = AndroidNotificationChannel(
    mobileOptions.id,
    mobileOptions.title,
    description: mobileOptions.description,
    importance: Importance.high,
  );
  PushNotificationService.localNotificationsPlugin =
      FlutterLocalNotificationsPlugin();
  PushNotificationService.permissionsObtained =
      await PushNotificationService.localNotificationsPlugin!.initialize(
    Platform.isAndroid
        ? const InitializationSettings(
            android: AndroidInitializationSettings("@mipmap/launch_image"),
          )
        : const InitializationSettings(iOS: IOSInitializationSettings()),
    onSelectNotification: (final payload) async {
      try {
        await GetIt.I<PushNotificationService>()
            .handleNotificationSelection(payload);
      } on Exception catch (error, stack) {
        errorLog(error.toString());
        errorLog(stack.toString());
      }
    },
  );
  if (PushNotificationService.permissionsObtained ?? false) {
    if (Platform.isAndroid) {
      await PushNotificationService.localNotificationsPlugin!
          .resolvePlatformSpecificImplementation<
              AndroidFlutterLocalNotificationsPlugin>()
          ?.createNotificationChannel(PushNotificationService.channel!);
    } else if (Platform.isIOS) {
      final impl = PushNotificationService.localNotificationsPlugin!
          .resolvePlatformSpecificImplementation<
              IOSFlutterLocalNotificationsPlugin>()!;
      PushNotificationService.permissionsObtained =
          await impl.requestPermissions(
        alert: true,
        badge: true,
        sound: true,
      );
      if (PushNotificationService.permissionsObtained ?? false) {
        await FirebaseMessaging.instance
            .setForegroundNotificationPresentationOptions();
      }
    }
  }
}

Future<void> _initPushNotificationsWeb() async {
  /*var notificationSettings =
      await FirebaseMessaging.instance.getNotificationSettings();
  if (notificationSettings.authorizationStatus ==
      AuthorizationStatus.notDetermined) {
    notificationSettings = await FirebaseMessaging.instance.requestPermission();
  }
  PushNotificationService.permissionsObtained =
      notificationSettings.authorizationStatus != AuthorizationStatus.denied;*/
  PushNotificationService.permissionsObtained = true;
}

// This is the service and its init() method is called in initState of the initialization route

class PushNotificationService
    extends ServiceNeedingInitOverrideOnly<Map<String, bool>> {
  PushNotificationService({required final this.changeFromRouteOnPush})
      : super(
          data: changeFromRouteOnPush,
          initType: FrameworkServiceInitType.backendWithoutAuth,
        );

  Map<String, bool> changeFromRouteOnPush;
  String? _token;
  Map<String, dynamic> _messageIds = {
    "device": {},
    "multicast": {},
  };
  final Map<String, RemoteMessage> _messages = {};
  static late FirebaseOptions options;
  RemoteMessage? initialMessage;
  late AudioPlayer? _audioPlayer;
  static late AndroidNotificationChannel? channel;
  static late FlutterLocalNotificationsPlugin? localNotificationsPlugin;
  static late bool? permissionsObtained;

  @override
  Future<void> init() async {
    await super.init();
    if (permissionsObtained != true) {
      state = FrameworkServiceState.initialized;
      return;
    }
    if (_token != null) {
      await _confirmToken();
      return;
    }
    await _initFirebaseMessaging();
    var result = await _getToken();
    if (!result) {
      return;
    }
    result = await _confirmToken();
    if (!result) {
      return;
    }
    await _handleStoredTokenAndMessageIds();
    if (kIsWeb) {
      _audioPlayer = AudioPlayer();
      await _audioPlayer!
          .setAsset(GetIt.I<ApplicationService>().data.pushNotifAudio!);
    }
    state = FrameworkServiceState.initialized;
  }

  Future<void> handleNotificationSelection(final String? payload) async {
    final message = _messages.remove(payload)!;
    final pushNotification = Platform.isAndroid
        ? PushNotification.android(message)
        : Platform.isIOS
            ? PushNotification.ios(message)
            : PushNotification.web(message);
    await _handleNotification(message, pushNotification);
  }

  Future<bool> handleInitialMessage() async {
    if (initialMessage == null) {
      return false;
    }
    final pushNotification = Platform.isAndroid
        ? PushNotification.android(initialMessage!)
        : Platform.isIOS
            ? PushNotification.ios(initialMessage!)
            : PushNotification.web(initialMessage!);
    final result = await _handleNotification(initialMessage!, pushNotification);
    initialMessage = null;
    return result;
  }

  Future<void> _initFirebaseMessaging() async {
    initialMessage = await FirebaseMessaging.instance.getInitialMessage();
    FirebaseMessaging.onMessage.listen((final message) async {
      await _handleNotificationWhileRunning(message);
    });
    FirebaseMessaging.onMessageOpenedApp.listen((final message) async {
      await _handleNotificationClickInvocation(message);
    });
  }

  Future<bool> _getToken() async {
    try {
      if (!kIsWeb) {
        _token = await FirebaseMessaging.instance.getToken();
      } else {
        _token = await FirebaseMessaging.instance.getToken(
          vapidKey: GetIt.I<ApplicationService>().data.fcmVapidKey,
        );
      }
      // ignore: avoid_catching_errors
    } on TypeError catch (error) {
      LoadDialog.hide();
      await LocalErrorDialog.show(error: error);
      return false;
    } on PlatformException catch (error) {
      LoadDialog.hide();
      await LocalErrorDialog.show(error: error);
      return false;
    } on MissingPluginException catch (error) {
      LoadDialog.hide();
      await LocalErrorDialog.show(error: error);
      return false;
    } on Exception catch (error) {
      LoadDialog.hide();
      await LocalErrorDialog.show(error: error);
      return false;
    }
    return _token != null;
  }

  bool hasToken() => _token != null;

  Future<bool> _confirmToken() async {
    try {
      await FcmToken.confirm(_token!);
    } on Http401Error {
      LoadDialog.hide();
      await onUnAuth();
      return false;
    } on Http403Error {
      LoadDialog.hide();
      await onUnAuth();
      return false;
    } on Exception catch (error, stack) {
      errorLog("Confirm token error: $error");
      errorLog(stack.toString());
      LoadDialog.hide();
      await BackendErrorDialog.show(error: error);
      return false;
    }
    return true;
  }

  Future<void> _handleStoredTokenAndMessageIds() async {
    await GetIt.I<LocalStorageService>()
        .overwriteByKey(LocalStorageKey.fcmToken, _token!);
    final messageIdsStr = await GetIt.I<LocalStorageService>()
        .getByKey(LocalStorageKey.pushMessageIds);
    if (messageIdsStr != LocalStorageService.nullValue) {
      _messageIds = json.decode(messageIdsStr);
    }
  }

  Future<void> _handleNotificationWhileRunning(
    final RemoteMessage message,
  ) async {
    try {
      final pushNotification = Platform.isAndroid
          ? PushNotification.android(message)
          : Platform.isIOS
              ? PushNotification.ios(message)
              : PushNotification.web(message);
      // ignore: avoid_dynamic_calls
      if (_messageIds[pushNotification.type].containsKey(pushNotification.id)) {
        return;
      }
      await _messageDialog(message);
    } on Exception catch (error, s) {
      errorLog("Error in handling notification while running: $error");
      errorLog(s.toString());
    }
  }

  Future<void> _messageDialog(final RemoteMessage message) async {
    _messages[message.hashCode.toString()] = message;
    final notification = message.notification!;
    if (!kIsWeb) {
      await localNotificationsPlugin!.show(
        notification.hashCode,
        notification.title,
        notification.body,
        Platform.isAndroid
            ? NotificationDetails(
                android: AndroidNotificationDetails(
                  channel!.id,
                  channel!.name,
                  channelDescription: channel!.description,
                  icon: '@mipmap/launch_image',
                ),
              )
            : const NotificationDetails(
                iOS: IOSNotificationDetails(
                  presentAlert: true,
                ),
              ),
        payload: message.hashCode.toString(),
      );
    } else {
      // ignore: unawaited_futures
      _audioPlayer!.play();
      await MessageDialog.show(
        title: notification.title!,
        message: notification.body!,
        callback: () {
          handleNotificationSelection(message.hashCode.toString());
        },
      );
    }
  }

  Future<void> _handleNotificationClickInvocation(
    final RemoteMessage message,
  ) async {
    try {
      final pushNotification = Platform.isAndroid
          ? PushNotification.androidPartial(message)
          : Platform.isIOS
              ? PushNotification.ios(message)
              : PushNotification.web(message);
      if (_messageIds.containsKey(pushNotification.id)) {
        return;
      }
      await _handleNotification(message, pushNotification);
    } on Exception catch (error, s) {
      errorLog("Error in handling click on notification: $error");
      errorLog(s.toString());
    }
  }

  Future<bool> _handleNotification(
    final RemoteMessage message,
    final PushNotification pushNotification,
  ) async {
    // ignore: unawaited_futures
    LoadDialog.show(
      title: GetIt.I<LocalMessageService>()
          .getContent(LocalMessageKey.processingNotification),
    );
    await _rememberMessageId(pushNotification);
    final updatedCount = await _updateNotificationAsBeingRead(pushNotification);
    if (updatedCount == null) {
      return false;
    }
    await _updateBadgeCount(updatedCount);
    LoadDialog.hide();
    return _handleNotificationAction(message, pushNotification);
  }

  Future<void> _rememberMessageId(
    final PushNotification pushNotification,
  ) async {
    // ignore: avoid_dynamic_calls
    _messageIds[pushNotification.type][pushNotification.id] = true;
    await GetIt.I<LocalStorageService>().overwriteByKey(
      LocalStorageKey.pushMessageIds,
      json.encode(_messageIds),
    );
  }

  Future<int?> _updateNotificationAsBeingRead(
    final PushNotification pushNotification,
  ) async {
    try {
      if (pushNotification.type == 'device') {
        return await DevicePushNotificationMessage.readMessage(
          pushNotification.id,
        );
      } else if (pushNotification.type == 'multicast') {
        return await MulticastPushNotificationMessage.readMessage(
          pushNotification.id,
        );
      }
    } on Exception catch (error, stack) {
      errorLog("Error while marking notification as read: $error");
      errorLog(stack.toString());
      LoadDialog.hide();
      await BackendErrorDialog.show(error: error);
    }
    return null;
  }

  Future<void> _updateBadgeCount(final int updatedCount) async {
    final isBadgeSupported = await FlutterAppBadger.isAppBadgeSupported();
    if (isBadgeSupported) {
      updatedCount > 0
          ? FlutterAppBadger.updateBadgeCount(updatedCount)
          : FlutterAppBadger.removeBadge();
    }
  }

  Future<bool> _handleNotificationAction(
    final RemoteMessage message,
    final PushNotification pushNotification,
  ) async {
    final goToRoute = pushNotification.route;
    final currentRoute = GetIt.I<RoutesService>().currentRoute();
    final toChangeRoute = goToRoute != null &&
        goToRoute.isNotEmpty &&
        goToRoute != "n/a" &&
        changeFromRouteOnPush.containsKey(currentRoute) &&
        changeFromRouteOnPush[currentRoute] != null;
    if (toChangeRoute) {
      final hasObjectId = pushNotification.routeObjectId != null &&
          pushNotification.routeObjectId!.isNotEmpty;
      if (hasObjectId) {
        final actualGoToRoute =
            goToRoute!.replaceFirst(":id", pushNotification.routeObjectId!);
        await _handleRouteChange(
          toReplace: goToRoute == currentRoute,
          path: actualGoToRoute,
          registeredPath: goToRoute,
        );
      } else {
        await _handleRouteChange(
          toReplace: goToRoute == currentRoute,
          path: goToRoute!,
        );
      }
    }
    return toChangeRoute;
  }
}

Future<void> _handleRouteChange({
  required final bool toReplace,
  required final String path,
  final String? registeredPath,
}) async {
  if (toReplace) {
    GetIt.I<RoutesService>().forceReplacementInfo = AppRouteInformation(
      path: path,
      queryParameters: FromArgument(
        refresh: true,
      ).queryParameters(),
      registeredPath: registeredPath,
    );
    await GetIt.I<RoutesService>().to(
      baseRouteNames[BaseRouteType.replacementForcer]!,
      isReplacement: true,
    );
  } else {
    await GetIt.I<RoutesService>().to(
      path,
      queryParameters: FromArgument(
        refresh: true,
      ).queryParameters(),
      registeredPath: registeredPath,
    );
  }
}

class MobilePushNotificationOptions {
  MobilePushNotificationOptions({
    required final this.id,
    required final this.title,
    required final this.description,
  });

  final String id;
  final String title;
  final String description;
}

The following is the initialize route widget that runs the init methods of all services including the push notification service through an application manager interface.
initialize route
class InitializeView extends StatefulWidget {
  InitializeView() : super(key: GlobalKey());

  static int initializeRouteCounter = 0;

  @override
  InitializeViewState createState() => InitializeViewState();
}

class InitializeViewState extends State<InitializeView> {
  @override
  void initState() {
    super.initState();
    if (InitializeView.initializeRouteCounter != 0) {
      Future.delayed(Duration.zero, () async {
        await GetIt.I<RoutesService>().to(
          GetIt.I<RoutesService>().redirectToAfterInitialize,
          isReplacement: true,
        );
      });
      return;
    }
    ++InitializeView.initializeRouteCounter;
    final applicationManager = GetIt.I<ApplicationManager>();
    if (applicationManager.state !=
            ApplicationManagerState.initializingNonLocal &&
        applicationManager.state !=
            ApplicationManagerState.nonLocalInitialized) {
      Future.delayed(Duration.zero, () async {
        final redirectTo =
            GetIt.I<RoutesService>().queryParameters()["redirect"];
        GetIt.I<RoutesService>().redirectToAfterInitialize = redirectTo;
        await applicationManager.initNonLocal();
        if (applicationManager.loadError != null) {
          // ignore: avoid_dynamic_calls
          if (applicationManager.loadError.runtimeType == Http401Error ||
              // ignore: avoid_dynamic_calls
              applicationManager.loadError.runtimeType == Http403Error) {
            await GetIt.I<RoutesService>().to(
              baseRouteNames[BaseRouteType.unAuth]!,
              isReplacement: true,
            );
          } else {
            await GetIt.I<RoutesService>().to(
              baseRouteNames[BaseRouteType.loadError]!,
              isReplacement: true,
            );
          }
        } else {
          await GetIt.I<RoutesService>().to(
            GetIt.I<RoutesService>().redirectToAfterInitialize,
            isReplacement: true,
          );
        }
      });
    }
  }

  @override
  Widget build(final BuildContext context) {
    final brand = GetIt.I<ApplicationService>().brandAssets();
    final profile = GetIt.I<ThemeProfile>();
    return safeFocusedNoNavigationPageScaffold(
      child: Container(
        margin: profile.pageClearance.separator,
        alignment: Alignment.topCenter,
        child: brand.splash,
      ),
    );
  }
}

I do not see much difference from how the example works after the pre-run sequence of initialising firebase. It runs the notification permissions fetching and token creation through initState of the app widget, too. In fact, I had modeled my service that was working fine pre-2.8 with all the code, including the permission asking on web before running the app. I did see some warnings on few browser that the notification permission must be asked through a button invocation; but that's about it. The app worked fine in the sense that it did not crash during the initialisation as reported.
At this point, I seriously do not see any difference in my app unless someone can point me to it.

I also built the firebase_message example and accessed the build using node http_server, and it works fine.
I also ran my app in debug mode (so far was trying to get the release version working); and I get the same crash. It occurs as soon as I look to access FirebaseMessaging.instance. The same steps done in the example app do not get the crash.

I put back the old code of having firebase messaging JS in index.html and the error went away.

@reeteshranjan
Thanks for the report. From what I understand going through your comments above, you use flutterfire_cli to generate firebase_options and used in your dart file instead of previous declarations and then trying to run your app on web, it's giving you the said exception. Correct me if I am wrong or missed any part.
From the medium article, it does say below:

Have you gone through this setup already ?

to fix which one needed the firebase JS files loaded and having extra code to initialise firebase app in index.html (or using an extra firebase-messaging-sw.js to have the initialisation code).

Can you provide exactly what's the fix you made which made the error go away ?

@darshankawar thank you for such a quick response.
About the snapshot shared by you: yes, as the article directed me to do: I removed all the firebase core and messaging related code from index.html which is no longer required with flutter 2.8 and presumably the latest firebase_core and firebase_messaging, as this article does not mention from which versions of firebase packages one should expect this dart-only firebase messaging initialisation to work.
To put it clearly, earlier my working code looked like this:
    <!-- This script installs service_worker.js to provide PWA functionality to
     application. For more information, see:
     https://developers.google.com/web/fundamentals/primers/service-workers -->
    <script src="https://www.gstatic.com/firebasejs/8.6.7/firebase-app.js"></script>
    <script src="https://www.gstatic.com/firebasejs/8.6.7/firebase-messaging.js"></script>
    <script>
      // Your web app's Firebase configuration
      // For Firebase JS SDK v7.20.0 and later, measurementId is optional
      var firebaseConfig = {
        apiKey: "...",
        authDomain: "...",
        projectId: "...",
        storageBucket: "...",
        messagingSenderId: "...",
        appId: "...",
        measurementId: "...",
      };
      try {
        // Initialize Firebase
        firebase.initializeApp(firebaseConfig);
      } catch (e) {
        if ("function" === typeof console.warn) {
          console.warn("Could not initialize firebase app");
          console.warn(e);
        }
      }
      if ("serviceWorker" in navigator) {
        window.addEventListener("flutter-first-frame", function () {
          navigator.serviceWorker.register(
            "flutter_service_worker.js?v=1849765427"
          );
        });
        window.addEventListener("load", function () {
          navigator.serviceWorker.register("/firebase-messaging-sw.js");
        });
      }
    </script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.4.456/pdf.min.js"></script>
    <script type="text/javascript">
      pdfjsLib.GlobalWorkerOptions.workerSrc =
        "//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.4.456/pdf.worker.min.js";
      pdfRenderOptions = {
        cMapUrl<EMAIL_ADDRESS>        cMapPacked: true,
      };
    </script>
    <script src="AgoraRtcWrapper.r9ce65cd.js"></script>
    <script src="main.dart.js" type="application/javascript"></script>

With firebase-messaging-sw.js included in above code being this:
importScripts("https://www.gstatic.com/firebasejs/8.6.7/firebase-app.js");
importScripts("https://www.gstatic.com/firebasejs/8.6.7/firebase-messaging.js");

try {
  const app = firebase.initializeApp({
    apiKey: "...",
    authDomain: "...",
    projectId: "...",
    storageBucket: "...",
    messagingSenderId: "...",
    appId: "...",
  });

  const messaging = firebase.messaging(app);

  messaging.onBackgroundMessage((message) => {
    console.log("onBackgroundMessage", message);
  });
} catch(e) {
  if ('function' === typeof console.warn) {
    console.warn("Firebase worker could not initialize app");
    console.warn(e);
  }
}

Now, as per the article, firebase-messaging-sw.js is no longer there and index.html trims down to:
    <!-- This script installs service_worker.js to provide PWA functionality to
     application. For more information, see:
     https://developers.google.com/web/fundamentals/primers/service-workers -->
      if ("serviceWorker" in navigator) {
        window.addEventListener("flutter-first-frame", function () {
          navigator.serviceWorker.register(
            "flutter_service_worker.js?v=1849765427"
          );
        });
      }
    </script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.4.456/pdf.min.js"></script>
    <script type="text/javascript">
      pdfjsLib.GlobalWorkerOptions.workerSrc =
        "//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.4.456/pdf.worker.min.js";
      pdfRenderOptions = {
        cMapUrl<EMAIL_ADDRESS>        cMapPacked: true,
      };
    </script>
    <script src="AgoraRtcWrapper.r9ce65cd.js"></script>
    <script src="main.dart.js" type="application/javascript"></script>

Next is that we can do Firebase.initializeApp in dart alone. What I see is that that's exactly what my existing code was anyway doing; but pre 2.8 and this article, the extra JS in index.html and firebase-messaging-sw.js was needed.
The utility of flutterfire CLI is not fundamental to this new dart-only mechanism working is what I understand especially after seeing what it does specific to my project at least. It just created a nice wrapper on top of all firebase messaging config. At least for web whether this is done or not should not matter; but I did it anyway just to keep close to the article.
So what happens is that the dart-only method creates the crash for my project.
What I did to fix things? Just put the extra JS back where it was in index.html and firebase-messaging-sw.js. The existing dart code of my project actually did not need to change.
Please let me know if I did not answer anything.

Thanks for the details. Labeling it based on the report and also since we are seeing some issues after following dart only initialization` documentation.

Sorry; I may not understand the labelling scheme much; but I think it is not a documentation type issue. Though it's surprising why the same sequence of code works in the firebase_messaging example and doesn't for my project, it's easy to see that things work with JS added back. Doesn't it point to something to do with the dart-only code? Should we not rule that out first before marking it as documentation type?

I've just tested the firebase_messaging example and it works as expected. Will reopen if you can provide a reproducible sample, but closing for now. Thanks.


Litmusctl should check existence of workflow name before scheduling & add the same if not present already

If the manifest provided by users doesn't contain name & only contains generateName, It fails with empty workflow name.
Issue :
Currently, Litmusctl expects the users to use workflow.metadata.name explicitly.
Reason :
Graphql-server also checks the workflow name provided via API parameters with workflow.metadata.name before scheduling so that we are able to track the workflow after scheduling. In UI also, we generate the workflow name ourself if workflow doesn't have it.
How we can enhance this?
Litmusctl can check if workflow contains workflow.metadata.name or not. If workflow contains workflow.metadata.generateName & not the workflow.metadata.name, Litmusctl can add the workflow.metadata.name by generating it by adding some hash to generateName . So, workflow.metadata.name will be workflow.metadata.generateName+(some-hash) .

Thanks @iamnicoj for this contribution!!. This is now released as part of 0.16.0 release of LitmusCTL.


Code block in Django web renders bad

I implement markdown in a django blog. All renders good except code block that, instead of:
def hello():
    print 'Hello'

is interpreted like:
:::python
def hello():
print 'Hello'
What am I doing wrong? Or it is a bug?

I'm going to need a lot more info to help you with that. What does the original Markdown source text look like? What arguments are being passed to Markdown? What HTML is being output? What CSS rules are being applied to that HTML?
I suspect that as you obtain that info, you will likely find the problem yourself. If not, please provide that info here as text in code blocks (not screenshots) and we'll help you work it out.

Okey, Let me explain.
I installed markdown and pygments. Then I execute pygmentize -S default -f html -a .codehilite > easydjango/static/css/custom.css to create pygments css file.
I crete a templatetag like this:
@register.filter
def markdownify(text):
    return markdown.markdown(text, safe_mode='escape', extension=['markdown.extensions.codehilite'])

After that I've experimented some issues.
If the source code looks like:
def hello():
    print 'Hello'

The output is: pyhton def hello(): print 'Hello'.
If the source code is:
:::python
def hello():
    print 'Hello'

The output will be (without codehilite classes):
:::python
def hello():
print 'Hello'

Code blocks need to be indented.  Codehilite allows you to add a language header, but it still requires you to indent your code.

Yes, I try it too and the response is the same as the last one I explain in the other comment

@polrodoreda, also it is extensions with an s for the parameter, not extension.

Thank you!! What a big mistake. Sorry!

I see that you initially tried a fenced code bock:
```pyhton
def hello():
print 'Hello'
```

Note also that fenced code blocks are non-standard Markdown. If you want to use them, you need to enable the fenced-code extension as well.


Row filter exceeds maximum size: in checkAndPut operation

This is a request to document a possible Bigtable client limit in the GCP docs.
Our Java application uses bigtable-hbase-1.x client to talk to Cloud Bigtable. We recently ran into an issue with our Java client, where a checkAndPut() operation returned with a INVALID_ARGUMENT: Row filter exceeds maximum size of 20480 bytes error.
In our code we do checkAndPut(byte[] row, byte[] family, byte[] qualifier, byte[] value, Put put) on a reasonably small table. The table may have about ~10,000 rows. Three column families. The value in a cell are mostly around ~100KB, with a handful of cells around 1.3MB. I think the checkAndPut gets translated into a checkAndMutate() request in in com.google.cloud.bigtable.hbase.AbstractBigtableTable.java, and internally it creates a filter based on the value, which may exceed some internal limits.
If this is indeed a limitation, documenting this and the value of the limit will be helpful.

Hi,
You analysis is correct. We'll update our docs to reflect this limitation.

Hi, we have a similiar issue. On one of our tables in a single entry we have ~2MB of data, which results with the error:
Caused by: com.google.bigtable.repackaged.com.google.api.gax.rpc.FailedPreconditionException: com.google.bigtable.repackaged.io.grpc.StatusRuntimeException: FAILED_PRECONDITION: Failed to read from the table ''<table_name>'. Row '\.......(length 80)' exceeds the rowsize limit (https://cloud.google.com/bigtable/quotas#limits-data-size). Make sure you are setting an appropriate request filter to retrieve only recent versions and only the columns you want. If columns are accumulating more versions than you need to read, you can also create a garbage collection policy: https://cloud.google.com/bigtable/docs/configuring-garbage-collection#versions
Is there a workaround that we can use? We're using bigtable-beam-import.jar export to create backups of our cluster, which isn't working right now.
If I understand correctly it will be the A row filter cannot exceed 20 KB. If you receive an error message, you should redesign or shorten your filter. limit?


Extension cannot fetch pull requests on VSCode's fork cursor

Extension version:
v0.80.1

VSCode Version:
1.89.0

cursor Version:
0.32.2

cursor VSCode Version:
1.86.2

OS:
13.5.1 (22G90)

Repository Clone Configuration (single repository/fork of an upstream repository):
single repository, cloned via git@github.com:...

Github Product (Github.com/Github Enterprise version x.x.x):
github.com

Fresh install of the extension, clicking the refresh pull requests lists icon yields the following error:

Error:

alexr00

Hey alex, thanks for answering.
In the my issue title, I am referring to Visual Studio Codes "fork" (I thought it was a fork) https://github.com/getcursor/cursor https://cursor.sh/
The repository I am hitting is not a fork. It is a private single repository

We only test the extension with VS Code. Can you also reproduce the issue with VS Code?

@alexr00 on VSCode it works

Thanks @felix-droese! Sounds like a bug in cusor then.


feat: base price on category

https://dev.azure.com/plentymarkets/plentymarkets/_sprints/backlog/BD - Team - LM/plentymarkets/Areas/Sprint 33?workitem=63854

we should use product getters from productGetters not cartGetters...

@maxiroellplenty
2 questions
1.are you sure about this request:
"Try to unify changes by having reusable components (LTS uses the same item-component for basket-preview, Basket and checkout >> basketListItem.vue"
Both files in which cart product list is used have diferent ways of displaying the product list (table style..)
2.should't we use getter function only from productGetters when whe display product fields? (for a new dev that interacts with the app seems more straight forward..)

currently failing paypal e2e,i think it does't have to do with changes in current branch


WIP:prevent networkmanager from controlling eth0

Can one of the admins verify this patch?

"ok to test" to accept this pull request for testing
"test this please" for a one time test run
"add to whitelist" to add the author to the whitelist

Can one of the admins verify this patch?

"ok to test" to accept this pull request for testing
"test this please" for a one time test run
"add to whitelist" to add the author to the whitelist

Add description to PR stating problem trying to address.

don;t we need this for other rhel envs? (ceph and ceph_swift)?

added for ci-ceph-redhat and ceph-swift-rhel as well


Sort entries and remove duplicates in all-boxes

... and some smaller changes in Makefile.

This is one more component to achieve reproducible training.


Optional --binary-endpoint-security under insecure_dev_mode

--security=insecure_dev_mode modifies the default
--http-endpoint-security to optional, we should probably do the same to --binary-endpoint-security to be consistent, so that insecure_dev_mode is the only option to set in order to allow cleartext under any protocols, while we still preserve the options to accept cleartext in a particular protocol (binary or http).

Is this needed by something?

Is this needed by something?

Not really, it's just users found binary cleartext not working under insecure_dev_mode as its name suggests.


Support CommonJS?

I wanted to capture @ljharb’s suggestion from the meeting that this “map /foo to /dist/foo.mjs“ functionality might be useful to CommonJS as well. When we wrote this proposal we were assuming that CommonJS’ design space was basically frozen and would essentially be deprecated once Node starts supporting ES modules, but if that’s not the case then we should consider whether this proposal or parts of it should apply to CommonJS.
If "exports" is no longer a signifier that a package exports ESM (or exclusively ESM) then the file specifier proposal would need another field to signify as such. That could be "mode", which would then need to have three potential values (CommonJS, ESM or dual). As we talk about potentially multiple new package.json fields I’m also thinking we should consider a nodejs namespace in package.json. (https://github.com/nodejs/modules/issues/214).

I think we can support exports in CommonJS, even without affecting exports as a content type map signal. But it would mean that we make it harder to safely import those libraries because we're mixing different loading mechanisms inside of the same object literal.
One answer is to make exports more complicated by forcing additional nesting which I think would just make it harder to use.

I'd expect "mode" to have many future values, considering there's not just CJS and ESM, there's also WASM, HTML, and infinite potential future parse goals.

For me "mode" is just making a subtle switch in the file extension to content type mapping for loading from the disk. I would expect that all other entries in the map aren't affected (JSON, WASM, HTML, etc. would be mapped the same in all modes).

Making a first-class way to switch between two of the infinite potential entries in the mapping seems short-sighted. I'm all for having a way to override the parse goal of a given extension (or mime type, i suppose), but it would have to be generic across all of them - not privilege CJS and ESM JS code.

Re the title here... can I ask why we would want to port to CommonJS?
I feel that this adds complexity to the proposal and brings in a whole lot of new concerns that can be avoided if we keep it to ESM.
For example, dual mode packages can no longer just rely on "exports" being ESM-only... we now want exports to apply differently between CJS and ESM packages. How could we solve this?
We need a good reason to dive into that complexity, that I don't feel has been justified, and it runs the risk of taking the entire proposal down this rabbit hole now.

Yes, I’m inclined to not backport this to CommonJS. If the point is to give people reasons to upgrade to ESM, we shouldn’t be adding features to CommonJS.

People won’t upgrade if the friction is too high - features in ESM need to exist in CJS for that to be the case.

People won’t upgrade if the friction is too high - features in ESM need to exist in CJS for that to be the case.

I don’t follow; why do features new to ESM need to exist in CJS for people to upgrade to ESM?
I can see the logic of CJS features not existing in ESM being a barrier to upgrading, like if ESM didn’t support deep imports; but I don’t see how the lack of some feature in CJS would discourage anyone from upgrading to ESM. They aren’t using feature X now, and they can upgrade to ESM and . . . still not use feature X. If at some later point they decide to start using feature X, they can.
As @bmeck pointed out, I think it’s worth being mindful of the potential desire to backport the mapping feature to CommonJS, as we design the ESM version, so that we don’t foreclose on that possibility. Part of that is ensuring that we don’t treat the exports key as an ESM signifier, and choose or create something else instead. But I don’t think we need to add this feature to CommonJS as part of our ES modules implementation, and certainly not as part of Phase 2. I think it would be a fine feature to add to CommonJS, but that can be a wholly separate effort as a PR against Node core after the ES modules implementation is done.

I think ESM shouldn’t have features that CJS doesn’t - we’re not adding a replacement module system, we’re adding a second module system.

Yes.


first commit

Now that our style guide is back and making headlines I'd suggest having a look at it for some practical advice.

Also, meant to add - you need to update the small sample database that comes with this to include empty versions of the two new tables.


Namespaces cleanup

Mostly removed .Definitions namespace from R.Core and R.Editor. No code logic change. Reformat few files and added test categories to some tests that lacked them

:shipit:


Added OverscrollIndicator, removed OverscrollIndicatorPainter

Like Scrollbar, OverscrollIndicator use the ScrollNotification machinery to stay in sync with a Scrollable.

LGTM


[Relay] relay.Var allows special characters like : while chose are not allowed in the compiler

In the current TVM, relay.Var would accept variable names like input:0 while in the compiler : is a special character and we are sanitizing these name before passing it to the compiler.
The solution could be adding check in the relay.Var itself. This would result in adding sanitization in different places like frontends.
cc @AndrewZhaoLuo @slyubomirsky @areusch

I say just put the sanitation in relay.Var, make it automatic and call it a day B).

@AndrewZhaoLuo no, I have a follow up draft PR which should fix this as you suggested
https://github.com/apache/tvm/pull/13086


[Question]: Does the Cohere llama-index interface support RAG

Question Validation

[X] I have searched both the documentation and discord for an answer.

Question
I have tried to use Cohere as my llm for a RAG service context but the cohere llm doesn't seem to answer based on any retrieved information. It answers based on prior knowledge. What could be the issue?

Hi @gich2009 ,
Haven't faced such issue in my experiments. One way to look is if you are able retrieve the right chunks? If not then there should be an issue with embedding model.

Hi @ravi03071991, Let me try writing a script and see if I'll Replicate the issue and post it here. Thanks for the prompt help.

Hi @ravi03071991, I've been able to trace the issue. So when the service_context has LLM as Cohere and embed_model as CohereEmbeddings, then it is passed into the query engine, it works pretty well.
But when the same conditions are used but for a chat engine, the Cohere LLM uses it's prior knowledge. Let me give you the scripts then you can try and run them on your side:
Query Engine script:
import os
import openai
from llama_index import (
VectorStoreIndex,     #This is a database for embeddings.
SimpleDirectoryReader,  #This takes the document and splits it into sections(nodes or chunks), then does embedding.
StorageContext,         #This specifies which database to use for storing embeddings.
load_index_from_storage, #This is a function that helps you load embeddings from your vector store
ServiceContext,
set_global_service_context
)
from llama_index.embeddings import CohereEmbedding, OpenAIEmbedding
from llama_index.llms import Cohere
from llama_index.prompts import PromptTemplate
from dotenv import load_dotenv
import logging
import sys
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout))
load_dotenv()
OPENAI_API_KEY = os.getenv('OPENAI_API_KEY')
model = "command"
temperature = 0.5
COHERE_API_KEY = os.getenv('COHERE_API_KEY')
embed_model = CohereEmbedding(cohere_api_key=COHERE_API_KEY)
embed_model = OpenAIEmbedding(api_key=OPENAI_API_KEY)
service_context = ServiceContext.from_defaults(llm=Cohere(model=model, temperature=temperature, api_key=COHERE_API_KEY), embed_model=embed_model)
set_global_service_context(service_context)
check if storage already exists
if (not os.path.exists('./storage')):
documents = SimpleDirectoryReader('data').load_data()
index = VectorStoreIndex.from_documents(documents=documents, service_context=service_context)
index.storage_context.persist()
else:
# load the existing index
storage_context = StorageContext.from_defaults(persist_dir='./storage')
index = load_index_from_storage(storage_context)
query_engine = index.as_query_engine(service_context=service_context)
def query_bot(prompt: str):
response = query_engine.query(prompt)
# print(response.repr())
return response.response
if name=='main':
test_prompts = [
#Insert test prompts
]
for test_prompt in test_prompts:
response = query_bot(prompt=test_prompt)
print(response)
Chat Engine
import os
import openai
from llama_index import (
VectorStoreIndex,     #This is a database for embeddings.
SimpleDirectoryReader,  #This takes the document and splits it into sections(nodes or chunks), then does embedding.
StorageContext,         #This specifies which database to use for storing embeddings.
load_index_from_storage, #This is a function that helps you load embeddings from your vector store
ServiceContext,
set_global_service_context
)
from llama_index.llms import Cohere
from llama_index.embeddings import CohereEmbedding, OpenAIEmbedding
from dotenv import load_dotenv
import logging
import sys
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout))
load_dotenv()
OPENAI_API_KEY = os.getenv('OPENAI_API_KEY')
model = "command"
temperature = 0.5
COHERE_API_KEY = os.getenv('COHERE_API_KEY')
embed_model = CohereEmbedding(cohere_api_key=COHERE_API_KEY)
embed_model = OpenAIEmbedding(api_key=OPENAI_API_KEY)
service_context = ServiceContext.from_defaults(llm=Cohere(model=model, temperature=temperature, api_key=COHERE_API_KEY), embed_model=embed_model)
set_global_service_context(service_context)
check if storage already exists
if (not os.path.exists('./storage')):
documents = SimpleDirectoryReader('data').load_data()
index = VectorStoreIndex.from_documents(documents=documents, service_context=service_context)
index.storage_context.persist()
else:
# load the existing index
storage_context = StorageContext.from_defaults(persist_dir='./storage')
index = load_index_from_storage(storage_context)
chat_engine = index.as_chat_engine(service_context=service_context, chat_mode="condense_plus_context")
def chat_bot(prompt: str):
response = chat_engine.chat(prompt)
# print(response.repr())
return response.response
if name=='main':
test_prompts = [
# Insert test prompts
]
for test_prompt in test_prompts:
response = chat_bot(prompt=test_prompt)
print(response)

Hi @ravi03071991 , please remember to investigate this issue. There are a couple of issues I've seen that have been assigned to you but don't forget to check this out as well.

This issue is fixed as of v0.9.16.post2.

I don't think this issue is fixed. Using Cohere as the LLM still responds without context. Very easy to repro with the code below. Not specifying Cohere as the LLM shows that OpenAI just works.
import logging
import os
import sys
from dotenv import load_dotenv
from llama_index import (ServiceContext, StorageContext, VectorStoreIndex,
                         load_index_from_storage, set_global_service_context, SimpleDirectoryReader)
from llama_index.llms import Cohere, OpenAI
from llama_index.embeddings import CohereEmbedding
from llama_index.text_splitter import SentenceSplitter

logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout))
load_dotenv()
# check if storage already exists
PERSIST_DIR = "./storage"

embed_model = CohereEmbedding()
text_splitter = SentenceSplitter(chunk_size=512, chunk_overlap=10)
service_context = ServiceContext.from_defaults(
    embed_model=embed_model, text_splitter=text_splitter, llm=Cohere())
set_global_service_context(service_context)

if os.path.exists(PERSIST_DIR):
    # load index from storage
    storage_context = StorageContext.from_defaults(persist_dir=PERSIST_DIR)
    index = load_index_from_storage(storage_context)
else:
    documents = SimpleDirectoryReader(".").load_data()
    index = VectorStoreIndex.from_documents(documents)
    index.storage_context.persist()
chat_engine = index.as_chat_engine(
    chat_mode="condense_plus_context", verbose=True)
chat_engine.chat_repl()

Hi, I had a similar problem. Has anyone solved it?


ci add required

set performance pipeline to required
rm unused files

Issue Number: close #xxx

Further comments
If this is a relatively large or complex change, kick off the discussion at<EMAIL_ADDRESS>by explaining why you chose the solution you did and what alternatives you considered, etc...

run buildall

run pipelinex_p0


Typos in term names for "telodendria" terms

The following terms have a typo in their name:
GO:0120209 - cone teleodendria
GO:0120210 - rod teleodendria
It should be "telodendria", an not "teleodendria".
Note: the spelling of the parent term and in the definitions appear fine

This is one of those weird tickets that is closed but appears in the open tickets list. I don't know what causes this?


rsync: Fix perl-substitution in rrsync

Motivation for this change
there is no (more) perl in /usr/bin
Notify maintainers
cc @peti @ehmry

the diff LGTM, but the base branch is wrong. Please target master, then we can backport it to release-19.09

hey @jonringer, thanks for the comment. I added a merge-request for master.

release-19.09 != nixos-19.09

I'm not exactly sure what the nixos-19.09 branch is used for, tbh

Closed in favour of #76749


Cannot read property browser_download_url of undefined

Hi,
In latest release of bundle tool (1.5.0), jar file is not attached as an asset. Because of which the Install bundle tool task is failing with error "Cannot read property browser_download_url of undefined".
Thank You.

Hi,
An issue is opened for this: https://github.com/google/bundletool/issues/205
Hope this will be solve soon

Hi @damienaicheh ,
Thank you for a quick response.

It's online!


Add a paragraph on storage lockdown

Although storage lockdown may not be directly related to egress lockdown,
it could be not obvious how cluster accesses its storage accounts.
Adding this brief description to clarify.

@johnmarco
Can you review the proposed changes?
When the changes are ready for publication, add a #sign-off comment to signal that the PR is ready for the review team to merge.
#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

#sign-off


WEngine CORs system doesn't support subdomains on allowed domains.

During a deep look into the code. i noticed that subdomains aren't allowed on WEngine code. that can cause problems on big projects that have many subdomains connected together to grab data. this issue will be fixed on this update.

This issue has been fixed at: 3e1c73e


Add rate limiting to GeoprocessingHandler

Handlers should have a sane default rate limit and also respect options specified by the author. This may be possible to implement using API Gateway, but if not it could be done in the handler code.

@underbluewaters what should the rate limit/burst limit be?

This might require a little research. There are a couple major use cases for rate limiting, not entirely related.

Is purely automated abuse. We want humans running these, so maybe limit to 30 per minute or so? This may already be handle sufficiently by API Gateway. I'm not sure what they have in place.
Would be to prevent cost overruns. It would be awesome if we could specify in a GeoprocessingHandler a dollar amount not to exceed. Maybe pull data from cloudwatch metrics and shutdown the service if it exceeds $10 in a month (by default). We wouldn't want to slow down requests for this though. Maybe it could be a periodic cron lambda that reads the stats every hour or so and sets a flag in dynamodb to reject requests. Code for checking should probably be highly modular because when we get to container-based tasks we will probably want to check on every run since they can cost a few dollars each time.

It's easy to set the method-level throttling for a stage on the api gateway, by adding this to createStack apigateway.RestApi:
    deployOptions: {
      throttlingBurstLimit: 20,
      throttlingRateLimit: 40,
    },

these options are requests per second. I was thinking of the workshop use case, where, for example, there were 25 people sitting in a room and will said "ok, view the reports". There's a chance all 25 people would post those requests within 1 second of each other...and if we had a limit of 30/minute some of them would get rejected. That's why I've arbitrarily chosen 40 at the moment (burst rate is half the rate limit because that's the way the defaults are)...
Does that sound reasonable? Too high?

I think that seems good. Especially if it's something that can be customized in the GeoprocessingHandler options. Safe bet would be to have high defaults for rate-limiting, and then the cost limiting is where authors can be more conservative. I guess that opens up the possibilities for real dos'ing but that seems less of a risk than someone being surprised by a big bill.

These limits are in place, closing


kubernetes.default.svc.cluster.local

BUG REPORT

Version of Helm and Kubernetes:
Helm version 2.8.2
Kubernetes 1.9,3 (Hypercube CoreOS.0)
Which chart:
rabbitmq-ha
What happened:
Pods won't connect to  cluster_formation.k8s.host
What you expected to happen:
Connect to it.
How to reproduce it (as minimally and precisely as possible):
We used a custom cluster_name but the configmap template uses the fully qualified default name and is not configurable.
It should eiterh use kubernetes.default or be configurable in terms of cluster_name
Line 58 https://github.com/kubernetes/charts/blob/master/stable/rabbitmq-ha/templates/configmap.yaml
Anything else we need to know:

Bump?

Seeing the same using Helm 2.9.1 and Kubernetes 1.11. I'm getting stuck in CrashLoopBackoff with:
{"Kernel pid terminated",application_controller,"{application_start_failure,rabbit,{bad_return,{{rabbit,start,[normal,[]]},{'EXIT',{{case_clause,{error,"{failed_connect,[{to_address,{\"kubernetes.default.svc.cluster.local\",443}},\n I'm assuming this is the same thing you are seeing @Flowkap ?

Seems so. This is definitely a big as the value in the chart is fix but cluster name definitely is configurable.

@Flowkap Was able to work around this be providing a values.yml file that contained the IP and port of the kubernetes host instead of the DNS name. The two lines were:
  cluster_formation.k8s.host = <ip>
  cluster_formation.k8s.port = 6443

Not sure if it respects the port or not but I put it in for good measure. The rest of the file looked just like https://github.com/kubernetes/charts/blob/master/stable/rabbitmq/values.yaml . You can specify the value file on the command line when you install with helm:
helm install -f values.yaml --namespace=

Same problem here...

Same problem even now. I get the same issue listed above. Even after trying to do @JamesonNetworks  solution, doesnt solve the issue.


Web App formatting weirdly for some albums

Sometimes the Program formats without leftover space on the bottom after writing the songs. (Look in your reddit dms)

I will look into this issue. Thank you for reporting.

I implemented a small temporary fix but it fixes it for your instance


Android platform deploy

The StereoKit DLL needs to build for the Android platform, and there needs to be some kind of Xamarin support so StereoKit projects can deploy to Android platforms!

StereoKit can now build to Android, this works for both native code, as well as C# through Xamarin. Still some cleanup to go, but this feature works.


Updated the description of the website owner.

Thanks for merging my request.
I'll more glad to contribute if u can please mention it with hacktoberfest tag.
😊


add resonator Props

add resonator props
@imrishabh18 please check

Approved after rishabhs feedback is addressed!

@techmannih The bounty is there for the whole issue https://github.com/tscircuit/core/issues/426 which includes this as one of the task.


Allow EnvObj to be created by sdk

What
Allow EnvObj to be created by the sdk.
Why
The SDK gets RawVal's back from the Env (Host/Guest), but needs to convert them into EnvObjs, but there's no way for it to do that because the type is privately an EnvVal.
Known limitations
N/A

@graydon I needed to make EnvObj constructible on the SDK side since the Env only provides back RawVal's. Initially I did commit 7d7275402677aa15ed6430988d9ca3c046a57035 which didn't change much and just added a conversion function, but it felt a bit awkward to be specifying the tag value here again. I think defining EnvObj as explicitly having a RawObj makes it a bit more natural to use? Happy to discard the second commit and keep just the first commit if you prefer.


Data model setup check #39

ios_generator now searches for an AppDelegate.swift file, and if it finds one in a parent directory of the data_models path, it opens the file and searches for the string "sharedDataModel().setup()".  If it's not found, it outputs a warning to the user.
Fixes #39
@rmutter @baylee

@leemcdole some comments, and this could do with a test or two!

Addressed feedback, squashed gratuitous commits; added a couple of tests!

:checkered_flag:


Fix GPy.priors.InverseGamma

fixed InverseGamma prior: beforehand, it was a child class of Gamma but it defined a broken new method of its own. Now, it just inherits Gamma's new; also added a test that ensures the InverseGamma can be instantiated and integrated into a GPy model

Also, I'm curious why GPy.core.Model is Priorizable and has a set_prior() method - it's not a parameter itself.


Switch parameters order in validation functions

Updated ValidationEngine and ValidationDispatcher.
Updated spec files.
This closes #42.

Missing to update sample applicatins?


Is this project alive?

I've just tried it in various ways and found it to be not working even on basic stuff: installing, workflows, etc.
Specifically:

example workflow does not load with an error
there is no button to load custom plugins in the upper right corner of the UI
"user" directive in docker compose does not force the insides of the container to create files with that user and group

and much more

Hi! Are you running the latest beta, or the last release on GitHub? The latest beta is way ahead and we are many that run Porla without any issues, with both plugins and workflows.

Thank you for the response!
I was actually running the latest Docker image, not sure what version it was. I see that you just made a big release an hour ago, I updated the docker image - the workflows issue is now gone. Should I stick with it or better build a new image from the latest commit on main?

I'm pretty sure you were running v0.35. Since that release I haven't made an official release, but many have been running the beta versions built from main. The latest release (v0.37) is just a real release of the latest main 😄 If that makes sense.
Happy it fixed your issues!

Perfect, thank you!