Skip to content

Change browser module exportΒ #2299

Open
@dmackenz

Description

Context

  • node version: 12.12.0
  • module version: 17.1.0

What are you trying to achieve or the steps to reproduce ?

The documentation does not make it clear how @hapi/joi/dist/joi-browser.min.js can be imported and used like regular @hapi/joi. I am trying to use Joi in Karma.

// --- What I've tried:
import Joi from '@hapi/joi/dist/joi-browser.min.js';
import * as Joi from '@hapi/joi/dist/joi-browser.min.js';
import '@hapi/joi/dist/joi-browser.min.js';
import { Joi } from '@hapi/joi/dist/joi-browser.min.js';
// ---

export const createSchema = () => {
	return {
		scoresStore: {
			scores: Joi.array().length(4).items(Joi.number().equal(0)).required()
		},
		overallScoreStore: {
			root: Joi.object().required(),
			overallScore: Joi.number().equal(0),
			overallScoreTwo: Joi.number().equal(0)
		}
	};
};

Could someone tell me what the issue is here?

Metadata

Assignees

No one assigned

    Labels

    breaking changesChange that can breaking existing codebugBug or defect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions