Skip to content

[Bug] - Fix some issues discovered while implementing latest version of this package into NextJS app #20

@jupiter007

Description

@jupiter007

1)DefaultResearchOutputCustomColumn is not available to NextJS app. It needs to be added to the questions/index.ts file
2) These errors are breaking pages in NextJS app:

./dmptool-types/dist/dmp/index.js:7:30
Module not found: Can't resolve 'fs'
   5 | Object.defineProperty(exports, "__esModule", { value: true });
   6 | exports.ExtensionJSONSchema = exports.DMPToolExtensionSchema = exports.RDACommonStandardDMPJSONSchema = exports.RDA_COMMON_STANDARD_VERSION = void 0;
>  7 | const fs_1 = __importDefault(require("fs"));
     |                              ^
   8 | const path_1 = __importDefault(require("path"));
   9 | const zod_1 = require("zod");
  10 | const extension_1 = require("./extension");

https://nextjs.org/docs/messages/module-not-found

In @dmptool/types src/dmp/index.ts the code imports fs and the const RDA_COMMON_STANDARD_JSON_FILE = resolverSchemaPath() runs immediately when anyone imports this file. In the browser, all top-level code from index.ts executes immediately, and it tries to call fs.existsSync, but fs is undefined in the browser.

  1. selected was removed from options preventing a way for users to save default options when creating a question. It needs to be added back

  2. Need to fix the QuestionDefaultMap because some of the mappings are incorrect (example: boolean is mapped to DefaultAffiliationSearchQuestion

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions