Skip to content

[Bug] Build fails with Rspack after updating date-components to v3.3.0 #223

@hehmdalool

Description

@hehmdalool

Hello!

Today, I updated @gravity-ui/date-components in my project from version 3.2.4 to 3.3.0, and my build started to fail.

My project is built using @gravity-ui/app-builder, which configures Rspack for the build process.
Here are the relevant dependencies from my package.json before the problematic update:

{
  "@gravity-ui/app-builder": "^0.32.1",
  "@gravity-ui/date-components": "3.2.4",
  "@gravity-ui/date-utils": "^2.5.6"
}

After updating @gravity-ui/date-components to 3.3.0, I get the following error during compilation:

[client] Compiled with some errors in 45s 89ms  +45s 31ms 
ERROR in ./node_modules/@gravity-ui/date-components/dist/esm/components/DateField/utils.js 3:0-55
  × Module not found: Can't resolve '@gravity-ui/date-utils/build/dayjs' in './node_modules/@gravity-ui/date-components/dist/esm/components/DateField'
   ╭─[3:18]
 1 │ import React from 'react';
 2 │ import { dateTime, expandFormat } from '@gravity-ui/date-utils';
 3 │ import dayjs from '@gravity-ui/date-utils/build/dayjs';
   ·                   ────────────────────────────────────
 4 │ import { useLang } from '@gravity-ui/uikit';
 5 │ import { mergeDateTime } from "../utils/dates.js";
   ╰────
  help: Did you mean './node_modules/@gravity-ui/date-utils/build/dayjs/index.js'?
        
        The request '@gravity-ui/date-utils/build/dayjs' failed to resolve only because it was resolved as fully specified,
        probably because the origin is strict EcmaScript Module,
        e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"'.
        
        The extension in the request is mandatory for it to be fully specified.
        Add the extension to the request.
Rspack compiled with 1 error

I've traced this breaking change back to the v3.3.0 release. It appears to have been introduced in this commit:
9de3fa6#diff-b1afa32c971031c1c6d56e2afcded59b1f7cd273d6179fea874673b6b599b957R5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions