דילוג לתוכן
  • דף הבית
  • קטגוריות
  • פוסטים אחרונים
  • משתמשים
  • חיפוש
  • חוקי הפורום
כיווץ
תחומים

תחומים - פורום חרדי מקצועי

💡 רוצה לזכור קריאת שמע בזמן? לחץ כאן!
  1. דף הבית
  2. תכנות
  3. שגיאת קומפילציה באנגולר

שגיאת קומפילציה באנגולר

מתוזמן נעוץ נעול הועבר תכנות
4 פוסטים 2 כותבים 239 צפיות
  • מהישן לחדש
  • מהחדש לישן
  • הכי הרבה הצבעות
התחברו כדי לפרסם תגובה
נושא זה נמחק. רק משתמשים עם הרשאות מתאימות יוכלו לצפות בו.
  • yyyY מנותק
    yyyY מנותק
    yyy
    כתב ב נערך לאחרונה על ידי
    #1

    יש לי פרויקט באנגולר, וכשאני מקמפל אותו
    קופצת לי השגיאה הבאה (מצטער על האריכות אבל זה מה שיש)

    Error: node_modules/@mui/base/ButtonUnstyled/ButtonUnstyled.types.d.ts:1:8 - error TS1259: Module '"C:/myProjPath/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
    1 import React from 'react';
             ~~~~~
      node_modules/@types/react/index.d.ts:62:1
        62 export = React;
           ~~~~~~~~~~~~~~~
        This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
    Error: node_modules/@mui/base/InputUnstyled/InputUnstyled.types.d.ts:1:8 - error TS1259: Module '"C:/myProjPath/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
    1 import React from 'react';
             ~~~~~
      node_modules/@types/react/index.d.ts:62:1
        62 export = React;
           ~~~~~~~~~~~~~~~
        This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
    Error: node_modules/@mui/base/MenuUnstyled/MenuUnstyled.types.d.ts:1:8 - error TS1259: Module '"C:/myProjPath/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
    1 import React from 'react';
             ~~~~~
      node_modules/@types/react/index.d.ts:62:1
        62 export = React;
           ~~~~~~~~~~~~~~~
        This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
    Error: node_modules/@mui/base/ModalUnstyled/ModalUnstyled.types.d.ts:2:8 - error TS1259: Module '"C:/myProjPath/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
    2 import React from 'react';
             ~~~~~
      node_modules/@types/react/index.d.ts:62:1
        62 export = React;
           ~~~~~~~~~~~~~~~
        This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
    Error: node_modules/@mui/base/OptionGroupUnstyled/OptionGroupUnstyled.d.ts:1:8 - error TS1259: Module '"C:/myProjPath/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
    1 import React from 'react';
             ~~~~~
      node_modules/@types/react/index.d.ts:62:1
        62 export = React;
           ~~~~~~~~~~~~~~~
        This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
    Error: node_modules/@mui/base/OptionGroupUnstyled/OptionGroupUnstyled.types.d.ts:1:8 - error TS1259: Module '"C:/myProjPath/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
    1 import React from 'react';
             ~~~~~
      node_modules/@types/react/index.d.ts:62:1
        62 export = React;
           ~~~~~~~~~~~~~~~
        This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
    Error: node_modules/@mui/base/OptionUnstyled/OptionUnstyled.d.ts:1:8 - error TS1259: Module '"C:/myProjPath/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
    1 import React from 'react';
             ~~~~~
      node_modules/@types/react/index.d.ts:62:1
        62 export = React;
           ~~~~~~~~~~~~~~~
        This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
    Error: node_modules/@mui/base/OptionUnstyled/OptionUnstyled.types.d.ts:1:8 - error TS1259: Module '"C:/myProjPath/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
    1 import React from 'react';
             ~~~~~
      node_modules/@types/react/index.d.ts:62:1
        62 export = React;
           ~~~~~~~~~~~~~~~
        This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
    Error: node_modules/@mui/base/SelectUnstyled/useSelect.types.d.ts:1:8 - error TS1259: Module '"C:/myProjPath/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
    1 import React from 'react';
             ~~~~~
      node_modules/@types/react/index.d.ts:62:1
        62 export = React;
           ~~~~~~~~~~~~~~~
        This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
    Error: node_modules/@mui/base/SliderUnstyled/SliderUnstyled.types.d.ts:2:8 - error TS1259: Module '"C:/myProjPath/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
    2 import React from 'react';
             ~~~~~
      node_modules/@types/react/index.d.ts:62:1
        62 export = React;
           ~~~~~~~~~~~~~~~
        This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
    Error: node_modules/@mui/base/SliderUnstyled/useSlider.types.d.ts:1:8 - error TS1259: Module '"C:/myProjPath/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
    1 import React from 'react';
             ~~~~~
      node_modules/@types/react/index.d.ts:62:1
        62 export = React;
           ~~~~~~~~~~~~~~~
        This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
    Error: node_modules/@mui/base/SwitchUnstyled/useSwitch.types.d.ts:1:8 - error TS1259: Module '"C:/myProjPath/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
    1 import React, { HTMLInputTypeAttribute } from 'react';
             ~~~~~
      node_modules/@types/react/index.d.ts:62:1
        62 export = React;
           ~~~~~~~~~~~~~~~
        This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
    Error: node_modules/@mui/base/TabUnstyled/TabUnstyled.types.d.ts:2:8 - error TS1259: Module '"C:/myProjPath/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
    2 import React from 'react';
             ~~~~~
      node_modules/@types/react/index.d.ts:62:1
        62 export = React;
           ~~~~~~~~~~~~~~~
        This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
    Error: node_modules/@mui/base/TabUnstyled/useTab.types.d.ts:1:8 - error TS1259: Module '"C:/myProjPath/node_modules/@types/react/index"' can only be default-imported 
    using the 'allowSyntheticDefaultImports' flag
    1 import React from 'react';
             ~~~~~
      node_modules/@types/react/index.d.ts:62:1
        62 export = React;
           ~~~~~~~~~~~~~~~
        This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
    Error: node_modules/@mui/base/TabsListUnstyled/TabsListUnstyled.types.d.ts:1:8 - error TS1259: Module '"C:/myProjPath/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
    1 import React from 'react';
             ~~~~~
      node_modules/@types/react/index.d.ts:62:1
        62 export = React;
           ~~~~~~~~~~~~~~~
        This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
    Error: node_modules/@mui/base/TabsUnstyled/TabsUnstyled.types.d.ts:1:8 - error TS1259: Module '"C:/myProjPath/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
    1 import React from 'react';
             ~~~~~
      node_modules/@types/react/index.d.ts:62:1
        62 export = React;
           ~~~~~~~~~~~~~~~
        This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
    Error: node_modules/@mui/base/utils/appendOwnerState.d.ts:2:8 - error TS1259: Module '"C:/myProjPath/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
    2 import React from 'react';
             ~~~~~
      node_modules/@types/react/index.d.ts:62:1
        62 export = React;
           ~~~~~~~~~~~~~~~
        This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
    Error: node_modules/@mui/base/utils/isHostComponent.d.ts:1:8 - error TS1259: Module '"C:/myProjPath/node_modules/@types/react/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
    1 import React from 'react';
             ~~~~~
      node_modules/@types/react/index.d.ts:62:1
        62 export = React;
           ~~~~~~~~~~~~~~~
        This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
    Error: node_modules/@mui/utils/chainPropTypes.d.ts:1:8 - error TS1192: Module '"C:/myProjPath/node_modules/@types/prop-types/index"' has no default export.
    1 import PropTypes from 'prop-types';
             ~~~~~~~~~
    Error: node_modules/@mui/utils/elementAcceptingRef.d.ts:1:8 - error TS1192: Module '"C:/myProjPath/node_modules/@types/prop-types/index"' has no default export.      
    1 import PropTypes from 'prop-types';
             ~~~~~~~~~
    Error: node_modules/@mui/utils/elementTypeAcceptingRef.d.ts:1:8 - error TS1192: Module '"C:/myProjPath/node_modules/@types/prop-types/index"' has no default export.  
    1 import PropTypes from 'prop-types';
             ~~~~~~~~~
    Error: node_modules/@mui/utils/refType.d.ts:1:8 - error TS1192: Module '"C:/myProjPath/node_modules/@types/prop-types/index"' has no default export.
    1 import PropTypes from 'prop-types';
             ~~~~~~~~~
    ** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
    × Failed to compile.
    
    

    אני מבין לכאורה שמדובר באיזה שגיאה שקשורה ל-Input אבל אני לא בטוח. אני משתמש בפקדים של PrimeNg.
    אני לא מתעסק אם React, ואין לי מושג מה הוא רוצה ממני.
    אשמח מאוד לעזרה.

    katzK תגובה 1 תגובה אחרונה
    0
    • katzK מנותק
      katzK מנותק
      katz
      השיב לyyy ב נערך לאחרונה על ידי
      #2

      @yyy
      אני רואה שאתה משתמש עם https://mui.com/ שזה מיועד ספציפי לריאקט, איך אתה מייבא את PrimeNg לפרוייקט?

      מערכת שעות עבודה, https://timess.co.il/
      בלוג הקוד שלי: https://yossef7525.github.io/

      yyyY תגובה 1 תגובה אחרונה
      1
      • yyyY מנותק
        yyyY מנותק
        yyy
        השיב לkatz ב נערך לאחרונה על ידי
        #3

        @katz כתב בשגיאת קומפילציה באנגולר:

        @yyy
        אני רואה שאתה משתמש עם https://mui.com/ שזה מיועד ספציפי לריאקט, איך אתה מייבא את PrimeNg לפרוייקט?
        ממש לא בכוונה אא"כ זה תלויות של של PrimeNg, וזה הותקן לי אוטומטית.
        אני מיבא עם הפקודה
        npm install primeng
        ואח"כ בקובץ app.module.ts
        אני מכניס את המודול הרצוי.
        הנה המודולים שלי מ-PrimeNg

        imports: [
            BrowserModule,
            AppRoutingModule,
            HttpClientModule,
            FormsModule,
        
            BrowserAnimationsModule,
            TableModule,
            CalendarModule,
            SliderModule,
            DialogModule,
            MultiSelectModule,
            ContextMenuModule,
            DropdownModule,
            ButtonModule,
            ToastModule,
            InputTextModule,
            ProgressBarModule,
            ToolbarModule,
            SliderModule,
          CheckboxModule,
          InputSwitchModule,
          TooltipModule,
          ChartModule,
          AvatarModule,
          AvatarGroupModule,
          TagModule,
          InputNumberModule,
        
        yyyY תגובה 1 תגובה אחרונה
        0
        • yyyY מנותק
          yyyY מנותק
          yyy
          השיב לyyy ב נערך לאחרונה על ידי
          #4

          בינתיים מצאתי בגוגל פתרון להכניס ל-tsconfig.json את הרשומות הבאות

          "allowSyntheticDefaultImports": true,
          "esModuleInterop": true
          

          עדיין אשמח להסבר מה הייתההבעיה ומה הפיתרון. אני מרגיש כאילו איבדתי שליטה על ההגה לרגע קל...

          תגובה 1 תגובה אחרונה
          0

          בא תתחבר לדף היומי!
          • התחברות

          • אין לך חשבון עדיין? הרשמה

          • התחברו או הירשמו כדי לחפש.
          • פוסט ראשון
            פוסט אחרון
          0
          • דף הבית
          • קטגוריות
          • פוסטים אחרונים
          • משתמשים
          • חיפוש
          • חוקי הפורום