hapijs / joi-date

Joi extensions for dates
Other
83 stars 25 forks source link

Arrow function not transpiling in IE11 #30

Closed brvenkat closed 3 years ago

brvenkat commented 3 years ago

Support plan

Context

How can we help?

I am using joi-date from hapi as follows const joiDate = require('@hapi/joi-date');

The arrow function used in joi-date is not getting transpiled in IE11 due to which my app does not work in IE11. Attached screenshot from IE11. I get a syntax error and clicking on the link leads me to the screenshot below

Screen Shot 2020-08-11 at 1 08 22 pm
I am using babel7 and webpack4

Here is my webpack config
      {
        test: /\.js$/,
        exclude: /node_modules\/(?!.*hapi\/joi-date)/,
        loader: 'babel-loader',
      },
Tried using function version as well but did not help
        exclude: function(modulePath) {
          return /node_modules/.test(modulePath) &&
              !/node_modules\/@hapi\/joi-date/.test(modulePath);
        },

.babelrc entries
{
  "presets": [
    "@babel/env",
    "@babel/react",
    "@babel/preset-flow"
  ],
  "env": {
    "development": {
      "plugins": [
        "react-hot-loader/babel"
      ]
    }
  },
  "plugins": [
    [
      "@babel/plugin-transform-runtime",
      {
        "corejs": 2,
        "helpers": false,
        "regenerator": true
      }
    ],
    "@babel/plugin-syntax-dynamic-import",
    "@babel/plugin-syntax-import-meta",
    "@babel/plugin-proposal-class-properties",
    "@babel/plugin-proposal-json-strings",
    [
      "@babel/plugin-proposal-decorators",
      {
        "legacy": true
      }
    ],
    "@babel/plugin-proposal-function-sent",
    "@babel/plugin-proposal-export-namespace-from",
    "@babel/plugin-proposal-numeric-separator",
    "@babel/plugin-proposal-throw-expressions",
    "@babel/plugin-proposal-export-default-from",
    "@babel/plugin-proposal-logical-assignment-operators",
    "@babel/plugin-proposal-optional-chaining",
    [
      "@babel/plugin-proposal-pipeline-operator",
      {
        "proposal": "minimal"
      }
    ],
    "@babel/plugin-proposal-nullish-coalescing-operator",
    "@babel/plugin-proposal-do-expressions",
    "@babel/plugin-proposal-function-bind"
  ]
}

I tried adding @babel/plugin-transform-arrow-functions plugin as well but it did not help

hueniverse commented 3 years ago

Unfortunately, no community resources were available to help resolve this issue after two weeks, and it is being closed. We close unresolved community issues to keep the issue tracker organized and effective.