Skip to content

Commit

Permalink
null check
Browse files Browse the repository at this point in the history
  • Loading branch information
chaance committed May 18, 2022
1 parent 8026a1f commit 21e6f0d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/remix-dev/compiler/plugins/cssModulesPlugin.ts
Expand Up @@ -74,8 +74,9 @@ Install the dependency by running the following command, then restart your app.
config,
filePath: args.path,
});
let json = processed?.json || {};
return {
contents: JSON.stringify(processed?.json || {}),
contents: JSON.stringify(json),
loader: "json",
};
} catch (err: any) {
Expand Down Expand Up @@ -114,7 +115,7 @@ export function cssModulesFakerPlugin(
{ filter: suffixMatcher, namespace: pluginNamespace + "-faker" },
async (args) => {
let res = await assetsManifestPromiseRef.current;
let json = res?.cssModules?.moduleMap[args.path].json || {};
let json = res?.cssModules?.moduleMap[args.path]?.json || {};
return {
contents: JSON.stringify(json),
loader: "json",
Expand Down

0 comments on commit 21e6f0d

Please sign in to comment.